Это мой макет, который является бар действие, которое я построил:Почему этот центр не является центром?
<LinearLayout
android:orientation="horizontal"
android:id="@+id/Layout1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/button_blue_no_border">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:orientation="horizontal">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/white"
/>
<TextView
android:id="@+id/textActionBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:text="@string/app_name"
android:textStyle="bold"/>
</LinearLayout>
</LinearLayout>
Unfortunely изображение находится на левой стороне и TextView рядом с изображением. Я хочу, чтобы вторая линейная макет была сосредоточена в первом макете. Что мне делать?
использовать гравитацию insted of layout_centerHorizontal – Muthu
Вы хотите центрировать текст и оставить изображение слева? Или сосредоточить их обоих? –