I know it sounds easy. I need to put a text in center, but when the text is too long it needs to go below, but still align in the center of my xml.
Here's my code :
<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>
I put paddingTop and Bottom because I need some space. PS: My code is bigger; it's in a RelativeLayout.