[英]Crash when using UIPickerview as inputview for UITextfield in iOS 8
[英]UITextField with inputView showing UIPickerView… how to turn off translucency in IOS 7?
我們有一個標簽欄。 在其中一個控制器中,我們有一個UITextField。 單擊該按鈕將使用UITextField的inputView字段顯示一個選擇器。 我的團隊喜歡iOS 6上的外觀,但在iOS 7上,他們看到模糊的背景和標簽欄通過。 我可以關閉半透明功能嗎,我需要在哪里做?
self.termsPickerView = [[UIPickerView alloc] initWithFrame:CGRectMake(0, 43, 320, 480)];
self.termsPickerView.delegate = self;
self.termsPickerView.dataSource = self;
[self.termsPickerView setShowsSelectionIndicator:YES];
self.termTextField.inputView = self.termsPickerView ;
self.termTextField.delegate = self;
默認情況下,iOS 7.0中的UIPickerView
是半透明的,這就是性質,就像所有其他視圖一樣,它是控制顏色的簡單背景色。
因此,要解決您的問題,您可以
self.pickerView.backgroundColor = [UIColor whiteColor];
蘋果文檔沒有顯示任何關閉此透明度的方法。
tabBarController.tabBar.translucent = NO;
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.