Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios UITextField文本在编辑时向左移动1px_Ios_Ipad_Uitextfield - Fatal编程技术网

Ios UITextField文本在编辑时向左移动1px

Ios UITextField文本在编辑时向左移动1px,ios,ipad,uitextfield,Ios,Ipad,Uitextfield,在右对齐的文本字段中,编辑文本时,文本相对于占位符文本的位置向左移动1px。这不会发生在模拟器上,只会发生在设备上(本例中为iPad)。这是已知的bug吗?有办法解决吗 有一个类似的错误,但我没有使用自定义字体,只是使用系统字体。我以前遇到过这种情况,我认为这实际上是一个iOS错误。无论如何,苹果提供了两种方法,您可以在UITextField中重写。希望能有帮助 - (CGRect)textRectForBounds:(CGRect)bounds; - (CGRect)placeholderRe

在右对齐的文本字段中,编辑文本时,文本相对于占位符文本的位置向左移动1px。这不会发生在模拟器上,只会发生在设备上(本例中为iPad)。这是已知的bug吗?有办法解决吗


有一个类似的错误,但我没有使用自定义字体,只是使用系统字体。

我以前遇到过这种情况,我认为这实际上是一个iOS错误。无论如何,苹果提供了两种方法,您可以在UITextField中重写。希望能有帮助

- (CGRect)textRectForBounds:(CGRect)bounds;
- (CGRect)placeholderRectForBounds:(CGRect)bounds;