我的应用程序上有一些TextViews,我不知道为什么但是该android:gravity属性没有将文本内容集中在运行API 18+(4.3+)的设备上.
我在自定义上使用了代码TextView,这是RelativeLayout的子代:
<com.package.custom.CustomTextFont
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/seekbar"
android:layout_alignParentLeft="true"
android:layout_alignTop="@+id/seekbar"
android:layout_marginLeft="@dimen/margin_tiny_double"
android:layout_toLeftOf="@+id/seekbar"
android:gravity="center_vertical|left"
android:paddingRight="@dimen/margin_tiny"
android:text="@string/text1"
android:textColor="@color/black"
android:textSize="@dimen/size_text_normal" />
Run Code Online (Sandbox Code Playgroud)
这个代码应该采用这个代码的边缘TextView并将它对齐到顶部和底部并将它放在左边SeekBar,这是有效的,但是TextView变大了,所以android:gravity我将文本居中到中心并从中自取.它工作,但我不知道为什么,文本不在运行android 4.3和4.4的设备的中心左侧.此问题可以在真实设备上以及Eclipse的布局预览(图形布局)上重现.
对API 18+或android:gravity我遗漏的内容进行了哪些更改?
PS:我的目标是项目和AndroidManifest.xml上的API 19
PS2:我的TextView是自定义的,只是为了设置外部font.tff
这就是它在API 17上的样子 -

这就是它在API 18+上的样子

提前致谢!
= UPTADATE =
在我的Manifest上,我将其更改android:targetSdkVersion为17而不是19并且问题消失了,但这是一个"技巧",而不是解决方案,我能做什么,因为它可能是来自API的问题?是的,我有最新版本的API 18和19(今天,01/30/2014).