IOS PickerViewController

UIDatePicker

- setDatePickerMode:設置日期控件的顯示模式

- setLocale:設置是以什麼國家的形式來顯示,中國:zh_Hans_CN

NSDateFormatter內容,格式轉換器


訪問照相機,遵守協議:UINavigationControllerDelegate,UIImagePickerControllerDelegate

UIImagePickerController* imagePicker = [[UIImagePickerController alloc] init]  實例化圖像選擇控制器

[imagePicker setSourceType:UIImagePickerControllerSourceTypePhotoLibrary] 訪問本地照片庫

- setAllowsEditing:(BOOL)

設置代理 setDelegate

記住通過presentViewController展現圖片控制器


- (void)imagePickerController:(UIImagePickerController*)picker didFinishPickingMediaWithInfo:(NSDictionary*) info

在調用此方法之前,先輸出一下info,看裏面的鍵值

最後要dismissViewController


pickerView

視圖控制器要遵守DataSource和Delegate協議

列數和行數的設定,

- didSelectRow用來選定後返回數值的


- pickerView:(UIPickerView*) rowHeightForComponent:(NSInteger)component

間接設置Indicator的高度

setShowsSelectionIndicator:(BOOL) indicator是否可見

pickerView每一行可以返回UIView的,不侷限於文字。




發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章