uipickerview

Change UIPickerView background

蹲街弑〆低调 提交于 2019-12-17 04:56:04
问题 I want to change the border color of a UIPickerView. I do not see a tint property for the UIPickerView. Is there any way this could be done? Or a workaround? Thanks. 回答1: If you just want a workaround, take a screen shot in the simulator, open it in photoshop, crop it to just the UIPickerView area, make the center transparent, apply whatever tint you want, add that image to your project, and add it as a UIImageView on top of the UIPickerView. 回答2: You could also mask the component. With a bit

OC的UI开发基础之选择器——UIPickerView和UIDatePicker

 ̄綄美尐妖づ 提交于 2019-12-15 19:39:28
@implementation ViewController - ( void ) viewDidLoad { [ super viewDidLoad ] ; // Do any additional setup after loading the view. UIPickerView * pickerview = [ [ UIPickerView alloc ] initWithFrame : CGRectMake ( 50 , 100 , 300 , 100 ) ] ; //设置代理 pickerview . delegate = self ; //设置数据源 pickerview . dataSource = self ; /** 时间选择器(这个没有代理方法) */ UIDatePicker * datePicker = [ [ UIDatePicker alloc ] initWithFrame : CGRectMake ( 50 , 300 , 300 , 100 ) ] ; //设置显示模式 /** UIDatePickerModeTime, UIDatePickerModeDate, UIDatePickerModeDateAndTime, UIDatePickerModeCountDownTimer, 计时模式 */ datePicker .

Loading data in Component 2 after selecting component 1 picker View IOS

混江龙づ霸主 提交于 2019-12-14 04:14:00
问题 There are Three components (projects, tasks and sub tasks )in my pickerview when I select project, I was able to get the project name and respective project ID (Project ID is in label). My requirement is I want to send the project ID to NSURL so that I can load the respective tasks that are assigned to that project ID. Here is my Below Code. ViewDidLoad: // Code for Tasks loading NSString *nsTaskurllocal = @"http://test.com/"; NSString *usrid = @"313"; NSString * productIdString =[NSString

UIPickerView - multi-line rows - need layout advice

南笙酒味 提交于 2019-12-14 03:53:50
问题 I want to make picker with 2 lines, I tried it like a link , but I can not understand what I need to do: create a view and 2 label on it, when I add labels coordinates to code, but selection field still like it as default. How can I change selection field size? And text in selection field have bigger size when other lines. Sorry for my english. - (UIView*)pickerView:(UIPickerView *)thePickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view { UIView* v

Loading data in Component 2 after selecting component 1 picker View IOS

夙愿已清 提交于 2019-12-13 23:51:15
问题 There are Three components (projects, tasks and sub tasks )in my pickerview when I select project, I was able to get the project name and respective project ID (Project ID is in label). My requirement is I want to send the project ID to NSURL so that I can load the respective tasks that are assigned to that project ID. Here is my Below Code. ViewDidLoad: // Code for Tasks loading NSString *nsTaskurllocal = @"http://test.com/"; NSString *usrid = @"313"; NSString * productIdString =[NSString

how to set the data in second component based on first component selection in UIPickerview

一曲冷凌霜 提交于 2019-12-13 18:53:07
问题 I am using a UIpicker with three components. I want if I select a row in first component on the basis of selected component it shows the value of the corresponding data in second component. i used array for first component value like @"UK",@"US",@"EU" .now i want if user selected UK in first component then i want to load UKsize1=[NSArray arrayWithObjects:@"1",@"2",@"3",@"4",@"5", nil]; in second component , if user selected US in first component then i want EUsize2=[NSArray arrayWithObjects:@

UIPickerView Using NSDictionary

人盡茶涼 提交于 2019-12-13 18:24:44
问题 I am new to Swift Programming Language. I am trying to make a UIPickerView which work like select or listbox that contain key,value.If user select one from picker view,it gives me the key of that value. I have been browsing for almost half of the day trying to figure this out. All i got was UIPickerView using array results.All i want to know was how to store a Dictionary[key:value] in UIPickerView and if user select one of the value from picker,how to get the key. Please Help. With Regards 来源

How to block days in UIDatePicker for iOS

蓝咒 提交于 2019-12-13 16:31:16
问题 I'm using a Date picker on my IOS app, and I want to know if is possible to block some days. For example, I need to block all mondays from a year, is this possible? Thanks. 回答1: The only thing you can do is add a custom UIPickerView as described in the comments or implement a method that is called for the event UIControlEventValueChanged as described here then check the new value for a valid weekday. you can get the weekday with: NSCalendar* calendar = [NSCalendar currentCalendar];

implemented title attributed for row in picker view did not change the font?

妖精的绣舞 提交于 2019-12-13 16:19:06
问题 I tried to change the font of the title in my picker view, but for some reason I could not. I can change the color of the title, but the font remains intact? func pickerView(_ pickerView: UIPickerView, attributedTitleForRow row: Int, forComponent component: Int) -> NSAttributedString? { let attrTitle = NSAttributedString(string: splitPickerSource[row], attributes: [NSFontAttributeName: UIFont(name: "Avenir-Heavy", size: 17.0)!, NSForegroundColorAttributeName: UIColor.darkGray]) return

Bringing up a UIPickerview rather than keyboard input iOS

你。 提交于 2019-12-13 12:24:33
问题 Basically I would like to have the user click in the text field and it bring up a populated pickerview rather than a keyboard. This would also need a toolbar with a done button as well Im presuming. I currently have the field set as an output and action and not much more. I also have an actionsheet in code being used for when the user submits something as well if that makes any difference to possibly using an actionsheet for this as well. I tried researching this topic but 99% of the topics