У меня есть 2 текстовых поля в моем списке, которые я хочу, чтобы один из них имел правый выровненный и другой центр выравнивания , но все они aligend left !!! мой ListView XML:Два текстовых поля в списке aligend left
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_gravity="center"
android:id="@+id/tv_subject"
android:layout_weight="0.5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="20dp"
android:textStyle="bold" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<ImageView
android:id="@+id/iv_pic"
android:layout_gravity="left"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="5dp"
android:contentDescription="ads"/>
<TextView
android:layout_gravity="right"
android:paddingRight="5dp"
android:layout_weight="0.5"
android:id="@+id/tv_details"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
</LinearLayout>
это большая проблема для меня, пожалуйста, помогите мне.
Почему бы вам просто не использовать относительный макет? Затем вы можете вручную отрегулировать текст, где бы вы ни были. – SeahawksRdaBest
Если вы не хотите использовать реалистичные макеты, вы должны добавить 2 панели с андроидом: layout_weight: 1, который разделен на 2 равных части пространства, где вам понадобятся блоки в каждой панели, в форме, в которой вы нуждаетесь, каждый из которых вы помещаете вы хотите – phipex