Я знаю, это звучит легко.Мне нужно поместить текст по центру, но когда текст слишком длинный, он должен идти ниже, но все равно выравниваться по центру моего xml.
Вот мой код:
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/showdescriptioncontenttitle"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:layout_centerHorizontal="true"
>
<TextView
android:id="@+id/showdescriptiontitle"
android:text="Title"
android:textSize="35dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</LinearLayout>
Я поставил paddingTop и Bottom, потому что мне нужно немного места.PS: мой код больше;это в RelativeLayout.