DropDown in IPhone using UITextField,PickerView or DatePickerView
来源:互联网 发布:无网络最火的游戏 编辑:程序博客网 时间:2024/05/21 06:31
From: http://www.nevpro.co.in/blogs/entry/13-dropdown-in-iphone-using-uitextfieldpickerview-or-datepickerview.html
In Iphone xcode we do not have the Dropdown/select object that we can drag into our
Interface builder.Also if we use the UIPicker/UIDatepicker then it occupies more
space on iPhone screen. So there is alternate solution we have that when we start
editing the text of UITextField there will be pop-up occures of PickerView.
So in this blog we are going to see how to generate dropdown/select in xcode in iphone
in few steps.
Step 1: Open the xcode, create new application using View Base Application and name
it as 'GetDropdown'.
Step 2: Choose your interface builder. Here i selected Window ('Dropdown.xib').Now
you will see xcode automatically creates properly the directiory structure for you.
Step 3: Add two UITextFields one is for Simple PickerView and another is for DatePickerView
and add UIPickerView, UIDatePickerView on Interface Builder.
Step 4: Add new ViewController and Name it as 'popViewController' or if you have already
then go to step no.5
Step 5: Now select 'popViewController.h' add the following code:
Step 6:Now select 'popViewController.m' add the following code:
Step 7:Now Inspect the IBOutlet of your 'pop-ViewController.h' with your corresponding objects.
As you two add IBAction in your 'pop-ViewController.h' then inspect those IBAction with
corresponding UITextField's 'event property 'Editing Did Begin'.
Step 8:Now your application is done. So start compiling the applicaton. and run it.
You will get the following screen.
- DropDown in IPhone using UITextField,PickerView or DatePickerView
- iOS 去除PickerView ,DatePickerView黑色分割线
- Dropdown by index in ALV using in Web Dynpro
- Dropdown Box Using AJAX
- 个人收藏 Dropdown by index in ALV using in Web Dynpro
- Dropdown list in ALV
- Embedded DropDown in UltraGrid
- Using An Item Template With An HTML Dropdown Menu Component In Angular 2 RC 3
- iphone UITextField
- iphone--UITextField
- Using Core Plot in an iPhone Application
- Verilog Using $readmem or $readmemh in Modelsim
- dropdown
- iOS开发问题——UITextField弹出PickerView方法
- PickerView
- PickerView
- pickerView
- PickerView
- IOS基础:ActionSheet(上拉菜单)的实现
- powerbuilder9 连接 oracle 10g
- WinCE驱动开发问题精华集锦
- 豪客来优惠卷下载地址
- Java中加载properties文件的6种方法
- DropDown in IPhone using UITextField,PickerView or DatePickerView
- 网站开发之后台struts2乱码解决总结大全
- Drop down lists for iPhone: rolling your own
- mtu
- iPad如何在短短的三年内改变世界
- oracle数字转为字符串
- 缓存溢出Buffer Overflow
- javaMain实现发送邮箱
- 获得sim卡是几G卡