IOS之UIKit_Day10

day10ide

回顧:spa

               靜態表視圖orm

                     1》代碼對象

                     2》xib事件

               動態表視圖的實現方式圖片

                     1》代碼string

                     2》xib+代碼混合it

 

1.UITableBarController標籤控制器io

               1.1是什麼?form

                   與navagationcontroller很象 也是管理控制器的控制器

                    tabBarController沒有完整的外觀界面 靠管理其餘的VC來完成界面的顯示

                    管理方式橫向並列方式的     navagation傾向於垂直深刻式的管理

               1.2如何使用?

                  step1:將tabBarcontroller管理多個VC實例化出來具體對象

                  step2:將多個VC存到tabBar控制器裏面

               1.3tabBar的配置

                     .tabBaritem.title//顯示文字

                     .tabBaritem.image//顯示圖片

                     .tabBaritem.selectedImage//點擊時的圖片

                     .tabBaritem.badgeValue//徽章

                     .tabBarController.tabBar.tintColor//點擊時的圖片響應

          tabBarController.selectedIndex可讀可寫的屬性,用於獲取或設置tabBar中激活的vc的下標

                            響應用戶選中某vc事件:

                            -(void)tabBarController:(UITabBarController *)tabBarController  didSelectViewController:(UIViewController *)viewController

 

               1.4  tabBarController與navigationController的配合

                     1>多引導性控制器共存時,tabBar是總體最外層的管理者 navigation被tabbar管理的一個分支控制器

                     2>顯示第一屏時,tabBar能夠看見,在某一個具體的VC中推出新的VC時,tabBar處於隱藏狀態。只有回到頂級Vc時,tabBar區域纔可見

                     3>推出新VC隱藏底部各類bar的方法:

                            VC.hidesBottomBarWhenPushed=YES;

2. 其餘控件

               2.1SegmentedControl 分段控件

                     屬性:

                            selectedSegmentIndex選中的分段的按鈕下表

                     事件

                            ValueChange

 

               2.2Activity Indicator 活動指示器

 

               2.3Progress View進度條

 

               2.4Date Picker 時間選擇器

                     重要屬性:

                            date獲取選中後的時間對象 通常須要轉換成指定的格式

                     NSDate*date=self.datePicker.date

                     NSDateFormatter*formatter=[[NSDateFormatter alloc]init];

                     formatter.dateFormat=@「yyyy-MM-dd HH:mm:ss」;

                     NSString*dateString =[formatter stringFormDate:date];

 

               2.5Picker View

3.IOS8 中警告框和操做表

               3.1  建立

                            UIAlertController*alertController =

        [UIAlertControlleralertControllerWithTitle:@"Title"message:@"messsage"preferredStyle:UIAlertControllerStyleAlert];

               3.2 添加動做

                     UIAlertAction*cancelAction =[UIAlertAction actionWithTitle:@"取消" style: UIAlertActionStyleCancel  handler:^(UIAlertAction *action) {NSLog(@"Cancel");}];

                    

                     [alertControlleraddAction:cancelAction];

                     3.3 添加文本框

                     [alertControlleraddTextFieldWithConfigurationHandler:^(UITextField *textField){textField.secureTextEntry = YES;}];`

              3.4 推出顯示警告框

                     [selfpresentViewController:alertController animated:YES completion:nil];

相關文章
相關標籤/搜索