ios - Action 表中的 UIDatePicker 不起作用
<p><p>我正在尝试在操作表中显示 UIDatePicker,但它不起作用。</p>
<p>这是我的代码。单击按钮时,我已经编写了此代码</p>
<pre><code> UIAlertController *alertController = ;
UIView *datePickerView = [ initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 200)];
];
CGRect pickerFrame = CGRectMake(0, 0, self.view.frame.size.width, 200);
UIDatePicker *datePicker = [ initWithFrame:pickerFrame];
;
;
;
UIAlertAction* alertAction = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
}];
;
;
forKey:@"titleTextColor"];
</code></pre>
<p>这是更新后的代码。在模拟器中运行时它工作正常,但在设备中工作时我无法单击确定按钮(uialertaction)...尝试单击确定按钮选择器时正在连续滚动</p></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><p>由于 <code>UIActionSheet</code> 在 <code>iOS 8.3</code> 中已弃用,您需要使用 Apple 提供的文档和指南在屏幕中添加 <code>DatePicker</code>。</code> p>
<p>Apple 引入了内联日期选择器(如日历应用程序日期选择器)的使用。</p>
<p>使用下面的 github 代码进行内联日期选择器</p>
<p><strong>链接:</strong> <a href="https://github.com/DylanVann/DatePickerCell" rel="noreferrer noopener nofollow">https://github.com/DylanVann/DatePickerCell</a> </p>
<p><strong>供引用:</strong> <a href="https://stackoverflow.com/questions/18973573/ios-7-how-to-display-a-date-picker-in-place-in-a-table-view" rel="noreferrer noopener nofollow">iOS 7 - How to display a date picker in place in a table view?</a> </p></p>
<p style="font-size: 20px;">关于ios -Action 表中的 UIDatePicker 不起作用,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/41825929/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/41825929/
</a>
</p>
页:
[1]