UIAlertView键盘叠加textview问题 [英] UIAlertView keyboard overlay textview issue

查看:103
本文介绍了UIAlertView键盘叠加textview问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我找到了这段代码:

CGAffineTransform myTransform = CGAffineTransformMakeTranslation(0.0, 130.0);
[myAlertView setTransform:myTransform];

但似乎它需要将我的警报提升到顶部。如何将警报视图移至顶部?

But seems it want move up my alert to the top. How can I move up alert view to the top?

设置框架也无济于事。 alerView.frame = rect;

Set frame does not help as well. alerView.frame = rect;

推荐答案

你不能,如果你正在使用 UIAlertView 。来自apple docs:

You can't, if you're using a UIAlertView. From the apple docs:


警报视图的外观



您无法自定义警报视图的外观。

Appearance of Alert Views

You cannot customize the appearance of alert views.

其他地方....


子类注释



UIAlertView类旨在按原样使用,不支持子类化。此类的视图层次结构是私有的,不得修改。

Subclassing Notes

The UIAlertView class is intended to be used as-is and does not support subclassing. The view hierarchy for this class is private and must not be modified.

以及进一步..


使用带有警报视图的自动布局



为您处理警报视图的布局。您无法在警报视图和另一个用户界面元素之间创建自动布局约束。

Using Auto Layout with Alert Views

The layout of alert views is handled for you. You cannot create Auto Layout constraints between an alert view and another user interface element.

请参阅 Apple Docs 提醒视图

UIAlertView 从iOS8开始也不推荐使用,因此您应该使用 UIAlertController 。或者您可以制作一个自定义 UIView 来完成您需要它做的事情。

UIAlertView is also deprecated as of iOS8, so you should use UIAlertController instead. Or you could just make a custom UIView that does what you need it to do.

这篇关于UIAlertView键盘叠加textview问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆