开发者

Uitextfield in uitableview

开发者 https://www.devze.com 2023-02-08 07:12 出处:网络
Hii I am using one tableview controller having 11 textfields and 1 date picker and 1 picker. can i save this value in this controller or should I set this values in another controller .

Hii I am using one tableview controller having 11 textfields and 1 date picker and 1 picker. can i save this value in this controller or should I set this values in another controller .

I have seen almost example and they all have two views one for entering textfield and selecting picker value and when we save it it goes back and save all data in another view. Is This right way???? or I can use only one view????

If i used this in one view then cells clear values when i scroll table... 开发者_StackOverflow中文版plz help.


It is based on how you want the screen.. My point is you can keep all the things in the same view itself..

First the picker

Default hide both the pickers. When you select a tableview cell where you want the picker to be displayed, just set the hidden value of that picker to NO to show the picker with a toolbar. Keep the toolbar just above the picker with two UIBarburrons as done and cancel. done is for selecting the current selected value in the picker to display it the tableview and hide the picker again. Cancel to hide the picker again..

For textfield scrolling Try to create reusable cells so that you can check it and show the textfields according to that while scrolling the tableview..


firstly make a variable in appDelegate and then in this file where the picker and table view is commming , save these values in the appDelegate variable, and get the variable data in the another view with the deceleratoin of App Delegate

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号