【发布时间】:2013-03-26 20:07:09
【问题描述】:
我正在开发一个在 Xperia Z 和 Xperia tablet Z 上运行的 Android 应用。 我的问题是Gravity.RIGHT 属性在AndroidManifest 中的anyDensity=true 时生效,但是当anyDensity=false 时它不起作用。一些最右边的字符被部分隐藏,如下所示。 我在 TextView 和 Layout 中尝试了各种设置更改,但未能全部显示。有人可以告诉我我应该设置什么来让 Gravity.RIGHT 在 anyDensity=false 时完全工作吗?
谢谢。
`
----------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#000000"
>
<TextView
android:id="@+id/textDP"
android:textStyle="bold"
android:typeface="normal"
android:textSize="15.125dp"
android:textColor="#0000ff"
android:background="#cccccc"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:gravity="center_vertical|right"
android:layout_marginLeft="50px"
android:layout_marginTop="50px"
android:text="@string/Sample001"
/>
<TextView
android:id="@+id/textDP"
android:textStyle="bold"
android:typeface="normal"
android:textSize="15.125dp"
android:textColor="#0000ff"
android:background="#cccccc"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:gravity="center_vertical|right"
android:layout_marginLeft="50px"
android:layout_marginTop="75px"
android:text="@string/Sample002"
/>
: #Omission
----------------------------------------
`
【问题讨论】: