uipickerview

Add image to UITextField in Xcode?

a 夏天 提交于 2019-11-28 15:55:00
问题 I need to implement the concept of dropdown in Xcode. For that purpose, I'm using a UIPickerview . This pickerView loads when a textfield is tapped (on textFieldDidBeginEditing:)event. Question: Is there a way, that I can add a image to TextField ? The image is like an arrow mark by which user can understand that a dropdown appears when textfield is tapped .How can I make it? 回答1: UITextField has a rightView property, if you have image like this- then You can easly set ImageView object to

UIPickerView 模块示例demo

依然范特西╮ 提交于 2019-11-28 15:27:59
本文出自APICloud官方论坛 UIPickerView 此模块封装了一个可以从屏幕底部向上弹出的 action 选择器(3D滚轮效果)。开发者可自定义选择器的样式,包括:导航条颜色、高度,导航条上左右按钮大小、位置、背景色、title,选择器内容区域的背景、高度、字体大小颜色等样式。同时本模块支持自定义是否显示遮罩层及其样式,可监听用户点击遮罩层、导航条左右按钮等事件, 并在监听的事件里自行设置显示/隐藏(show/hide)模块的操作,灵活,多样。 亮点:滚动流畅,自定义数据源,丰富的配置参数。 效果图: open示例代码: var UIPickerView = api.require('UIPickerView'); UIPickerView.open({ styles: { navigator: { //(可选项)JSON对象;导航条配置 h: 44, //(可选性)数字类型;导航条高度;默认:44 bg: '#FFF', //(可选项)字符串类型;导航条背景色,支持rgb、rgba()、#、img;默认:#969696 titleSize: 20, //(可选性)数字类型;标题文本字体大小;默认:13 titleColor: '#EEB422', //(可选项)字符串类型;标题文本颜色,支持rgb、rgba、#;默认:#121212 title: '标题文字', //

UIPickerView 模块示例demo

孤人 提交于 2019-11-28 15:27:07
本文出自APICloud官方论坛 UIPickerView 此模块封装了一个可以从屏幕底部向上弹出的 action 选择器(3D滚轮效果)。开发者可自定义选择器的样式,包括:导航条颜色、高度,导航条上左右按钮大小、位置、背景色、title,选择器内容区域的背景、高度、字体大小颜色等样式。同时本模块支持自定义是否显示遮罩层及其样式,可监听用户点击遮罩层、导航条左右按钮等事件, 并在监听的事件里自行设置显示/隐藏(show/hide)模块的操作,灵活,多样。 亮点:滚动流畅,自定义数据源,丰富的配置参数。 效果图: open示例代码: var UIPickerView = api.require('UIPickerView'); UIPickerView.open({ styles: { navigator: { // (可选项) JSON 对象;导航条配置 h: 44, // (可选性)数字类型;导航条高度;默认: 44 bg: '#FFF', // (可选项)字符串类型;导航条背景色,支持 rgb 、 rgba ()、 # 、 img ;默认: #969696 titleSize: 20, // (可选性)数字类型;标题文本字体大小;默认: 13 titleColor: '#EEB422', // (可选项)字符串类型;标题文本颜色,支持 rgb 、 rgba 、 # ;默认:

Get selected value of a picker view that is present in different view and use the string in some other view

南笙酒味 提交于 2019-11-28 14:36:52
I have a picker view in a view controller page,say view controller1.Now I have a requirement of accessing the selected string value from that picker view in another view controller say view controller 2. This is because,I have a table view which displays the saved data corresponding to 4 groups i.e. my application is reminder application which user saves the reminder,that is visible in view reminder page.The reminders are saved by the user in respective groups,say friends,family,office etc... So I have earlier retrieved in a bad programming context,i.e. I took 4 view controllers for displaying

UIPickerView for each text field with different arrays (Swift/Firebase)

一个人想着一个人 提交于 2019-11-28 14:18:40
I am trying to create a form in which each text field has a UIPickerView which the user can use to select the option needed. I need a to use a different array of information for each text field but I can't seem to get it to work and I have been stuck on it for quite a while now. I have had a method which was possibly working but I couldn't then retrieve the data from the text field for Firebase due to each field having the same name. Here is my code so far, this is the latest method that I have tried that doesn't work: import UIKit import Firebase import FirebaseDatabase class

UIPickerView: Get row value while spinning?

﹥>﹥吖頭↗ 提交于 2019-11-28 13:32:41
I'd like to get the row value in real-time as the iPhone user spins a wheel in a UIPickerView (not just when the wheel settles onto a particular row). I looked into subclassing UIPickerView then overriding the mouseDown method, but I couldn't get this to work. Any suggestions would be very much appreciated. Perhaps try implementing the delegate method: - (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view You could treat it as a passthrough (just passing back the reusingView parameter) but each time it was

Reusing view in UIPickerView with iOS 7

北慕城南 提交于 2019-11-28 13:19:48
EDIT 12-14-2015 : This problem is again frequently reported on iOS 7, iOS 8, iOS 9.... I think Apple want not of this control anymore, and should just forbid us to use it instead of let such a major bug I use a UIPickerView with custom views loaded from a Xib. I was using the method -(UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view from UIPickerViewDelegate to reuse my views. With iOS 6, my UIPickerview works perfectly and my views are reused. Since iOS 7, the reusingView is always nil, so I need to load the

is there a uipickerview delegate method like scrollviewDidScroll?

∥☆過路亽.° 提交于 2019-11-28 12:29:30
I have a customized UIPickerview and I do not want to use a datepicker. I want to implement the feature where when a user scrolls down/up the hours, the AM/PM component switches while the hour is scrolling. This means that I need to switch it before pickerView didSelectRow is called. Is there a way to do this? Thanks Use following method, - (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component { // put your logic here. } Above method is from UIPickerViewDelegate, If user selects any element using pickerview, this method is automatically

UIPickerView - 1st row selection does not call didSelectRow

一世执手 提交于 2019-11-28 09:03:17
I have a UIPickerView on my UIView along with a UITextField . I am letting the user select a value from the picker or enter a custom value in the text field. When the user selects any option from the picker, the variable values are changed fine (in the pickerView:didSelectRow:inComponent: ) method. But if the user does not select any value on the picker (coz they want to select the 1st option which is already selected), this method is not called and the selection is not reflected in the variable. I tried setting the default value of the variable to the first option in the picker. But in that

IOS7 UIPickerView how to hide the selection indicator

眉间皱痕 提交于 2019-11-28 05:17:19
How can I hide those 2 lines on the selected row? motox [[pickerview.subviews objectAtIndex:1] setHidden:TRUE]; [[pickerview.subviews objectAtIndex:2] setHidden:TRUE]; Use this in titleForRow or viewForRow delegate method of the pickerView . Based on the other answers, I decided to enumerate the subviews and saw that the lines have a height of 0.5 so my solution now looks like this in Swift: func numberOfComponentsInPickerView(pickerView: UIPickerView) -> Int { pickerView.subviews.forEach({ $0.hidden = $0.frame.height < 1.0 }) return myRowCount } And in Objective-C - (NSInteger