UIPickerView内容居中显示,设置初始默认值
来源:互联网 发布:钢板承载力计算软件 编辑:程序博客网 时间:2024/03/29 00:58
系统默认的是内容居左显示的,有时会觉得不太好看,可以实现代理方法。
- (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view
{
UILabel *label = [[[UILabel alloc] initWithFrame:CGRectMake(12.0f, 0.0f, [pickerView rowSizeForComponent:component].width-12, [pickerView rowSizeForComponent:component].height)] autorelease];
[label setText:[pickerData objectAtIndex:row]];
label.backgroundColor = [UIColor clearColor];
[label setTextAlignment:UITextAlignmentCenter];
return label;
}
设置初始默认值
[pickerView selectRow:3 inComponent:0 animated:NO];
- UIPickerView内容居中显示,设置初始默认值
- UIPickerView内容居中显示,设置初始默认值
- UIPickerView内容居中显示,设置初始默认值
- c# 设置窗体初始化为居中显示
- 设置input 内容居中显示
- 设置input 内容居中显示
- 让UIPickerView居中循环显示数据
- UITextField通过UIPickerView显示选择内容
- C#设置DataGridView某一具体单元格的内容居中显示
- div内容居中显示
- JTable内容居中显示
- ExtJS内容居中设置
- 设置窗口居中显示
- sqlserver建表时设置字段初始默认值的示例
- 安卓 sinner 联动设置setOnItemSelectedListener初始默认值 实例
- JTalbe中内容居中显示
- 使组件内容居中显示
- 自定义AlertDialog内容居中显示
- 项目预估激发的矛盾
- spring mvc的获取参数和传递参数
- python 写的归并排序
- "Introduction to the Theory of Computation" Reading notes - Ch. 0 and 1
- 电容,电阻的误差值
- UIPickerView内容居中显示,设置初始默认值
- container_of
- 电子签名的早期应用与未来趋势
- Android将Activity打成jar包供第三方调用(解决资源文件不能打包的问题)
- PHPExcel分析
- Epoll and 介绍Sniff网络嗅探器代码
- linux安装之磁盘分区与系统目录的挂载
- 调用系统的短信和邮件分享功能
- iOS - webView检测电话和邮箱问题