如何将首选项页面的重力更改为右侧?

发布于 2024-11-19 13:10:19 字数 34 浏览 7 评论 0原文

如何将首选项页面的重力更改为右侧? 有什么解决办法吗?

How can I change the gravity of a preference page to RIGHT?
is there any solution?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

红焚 2024-11-26 13:10:19

所有首选项都有一个布局属性。您可以使用它来格式化所有波斯语文本。
然而,你给它的布局必须有一个ID为“@+android:id/title”的TextView。

这是一个简单的示例,其中添加了图像和右对齐的文本。

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="70dip"   
    >

    <ImageView
        android:id="@+id/perf_image"
        android:src="@drawable/pin_red"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_centerVertical="true" />

    <TextView
        android:id="@+android:id/title"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:textSize="23dip"
        android:layout_centerVertical="true"
        android:layout_toRightOf="@+id/perf_image"
        android:text="stuff"
        style="@android:style/TextAppearance.Widget.TextView.PopupMenu"
        android:gravity="right"
        />

</RelativeLayout>

All preferences have a Layout Attribute. You can use this to format all your Farsi text.
However the layout you give it must have a TextView with the id of "@+android:id/title".

Here is a quick example with an image added and right justified text.

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="70dip"   
    >

    <ImageView
        android:id="@+id/perf_image"
        android:src="@drawable/pin_red"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_centerVertical="true" />

    <TextView
        android:id="@+android:id/title"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:textSize="23dip"
        android:layout_centerVertical="true"
        android:layout_toRightOf="@+id/perf_image"
        android:text="stuff"
        style="@android:style/TextAppearance.Widget.TextView.PopupMenu"
        android:gravity="right"
        />

</RelativeLayout>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文