Текст по центру
Текст по центру
К 15 уроку возник вопрос - можно ли выравнять текст в TextView по центру без бубна? Как в css - text-align="center" и всё. Надоело, что текст все время слева торчит.
- xponchickx
- Сообщения: 3
- Зарегистрирован: 03 июн 2012, 00:38
Re: Текст по центру
android:gravity="right"
Re: Текст по центру
Код: Выделить всё
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:text="Some text" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:text="Some text" />