UICatalog 随手记
来源:互联网 发布:nvslp监控软件下载 编辑:程序博客网 时间:2024/05/29 13:04
解决问题:
xCode problem: You don't have permission to save the file "iOS DeviceSupport" in the folder 'XCode'
sudo chmod 777 /Users/<Acount>/Library/Developer/Xcode
1:MainViewControl
他是继承 UITableViewController,所以他自动带了tableview和很多table相关的代理
他使用了NSMutableArray + NSDictionary
在viewDidLoad里面初始化所有的数据(建议一个NSMutableArray)
在viewWillAppear保证没有选中标志
NSIndexPath *tableSelection = [self.tableViewindexPathForSelectedRow]; // 去掉以前选中的标志
[self.tableViewdeselectRowAtIndexPath:tableSelectionanimated:NO];
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section //设立section里面行数
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView //设立section数
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section //设立section标题
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath //设立行内容
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath // 设定点击的反应
UIViewController *targetViewController = [[self.menuListobjectAtIndex: indexPath.row]objectForKey:kViewControllerKey];
[[selfnavigationController]pushViewController:targetViewControlleranimated:YES]; // 切换viewcontrol
self.title = 。。。 // 设置自己view control的标题
2: Button
- typedef enum {
- UIButtonTypeCustom = 0, // no button type 自定义,无风格
- UIButtonTypeRoundedRect, // rounded rect, flat white button, like in address card 白色圆角矩形,类似偏好设置表格单元或者地址簿卡片
- UIButtonTypeDetailDisclosure,//蓝色的披露按钮,可放在任何文字旁
- UIButtonTypeInfoLight,//微件(widget)使用的小圆圈信息按钮,可以放在任何文字旁
- UIButtonTypeInfoDark,//白色背景下使用的深色圆圈信息按钮
- UIButtonTypeContactAdd,//蓝色加号(+)按钮,可以放在任何文字旁
- } UIButtonType;
建立button两种方式:
1:通过alloc+initwithframe来建立
UIButton *button = [[UIButtonalloc]initWithFrame:frame];
2:通过buttonWithType来建立
UIButton *button = [[UIButton buttonWithType:UIButtonTypeCustom] retain];
roundedButtonType = [[UIButtonbuttonWithType:UIButtonTypeRoundedRect]retain];
3: UITextField
typedefenum {
UITextBorderStyleNone,
UITextBorderStyleLine,
UITextBorderStyleBezel, // 普通边框
UITextBorderStyleRoundedRect // 圆角
} UITextBorderStyle;
通过alloc+initwithframe来建立
textFieldRounded.returnKeyType =UIReturnKeyDone;
textFieldRounded.clearButtonMode = UITextFieldViewModeWhileEditing;// has a clear 'x' button to the right
为了在按done 以后 消掉键盘:
设置一个textFieldRounded.delegate
并且:
- (BOOL)textFieldShouldReturn:(UITextField *)textField
{
// the user pressed the "Done" button, so dismiss the keyboard
[textFieldresignFirstResponder];
returnYES;
}
- UICatalog 随手记
- 随手记
- 随手记
- 随手记
- 随手记
- 随手记
- 随手记
- 随手记
- 随手记
- 随手记
- 随手记
- 随手记
- 随手记
- 随手记
- 随手记
- 随手记
- 随手记
- 随手记
- 各大IT公司2012校园招聘笔试面试整理--解题报告整理
- android canvas类
- linux常用命令
- window.onload的加载时间
- RAC上 read by other session 解决一例
- UICatalog 随手记
- 学习OpenCV——SVM
- 字符串中字符'\0'是二进制值为零
- 也论全排列的递归实现
- Windows Phone中的路由事件-以ListBox控件为例
- poj Labeling Balls 3687 拓扑排序!!!!
- Dataguard的switchover 和failover 并将老主库flashback 成standby库
- 9省启动IPv6试点
- Silverlight 基础收集