我正在开发一个ios应用程序,它有两个输入字段,用于输入日期。我计划以以下方式添加一个UIDatePicker
[_datePicker setFrame:CGRectMake([UIScreen mainScreen].bounds.size.width-_datePicker.bounds.size.width, [UIScreen mainScreen].bounds.size.height-_datePicker.bounds.size.height, _datePicker.frame.size.width, _datePicker.frame.size.height)]; _inputText.inputView=_datePicker;
但更大的问题是,我需要它看起来像我张贴的图片
我怎样才能做到这一点?
发布于 2015-07-30 21:18:20
好吧..。应该有几种方法来解决这个问题。
1)
在带有日期标签的视图上放置一个透明(或透明颜色) UIButton。在打开日期选择器之前,您可能需要使包含标签的视图更改颜色/alpha,以指示按钮已被触摸。
2)
如果上面的方法不起作用,try adding the view with the labels as a subview into UIButton。
https://stackoverflow.com/questions/31738282
复制