Прямо сейчас у меня есть таблица изображений 2x3, и мне нужно включить TextView
в нижней части окна, это то, что у меня есть для TextView
:Как разместить текст в TextView и сделать часть текста полужирным
<TextView
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:layout_gravity="center_horizontal|bottom"
android:text = "Hello Connor"
android:textColor = "#000000"
android:background = "@drawable/back"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
Сейчас он создает TextView
в нижней части экрана, однако мне нужен текст внутри коробки, чтобы быть центром, и мне нужно имя, «Коннор» быть смелыми. Как мне это сделать в XML?
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:background="@color/all_white">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1">
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1">
<ImageButton
android:background = "@android:color/transparent"
android:id="@+id/imagebutton1"
android:src="@drawable/button"
android:layout_width = "wrap_content"
android:layout_height = "wrap_content"
android:scaleType = "fitXY"
android:layout_marginTop = "50px"
android:layout_marginLeft = "40px"
android:layout_marginRight = "20px"
android:layout_marginBottom = "50px"
android:layout_weight="1"/>
<ImageButton
android:background = "@android:color/transparent"
android:id="@+id/imagebutton2"
android:src="@drawable/button"
android:layout_width = "wrap_content"
android:layout_height = "wrap_content"
android:scaleType = "fitXY"
android:layout_marginTop = "50px"
android:layout_marginLeft = "20px"
android:layout_marginRight = "40px"
android:layout_marginBottom = "50px"
android:layout_weight="1"/>
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1">
<ImageButton
android:background = "@android:color/transparent"
android:id="@+id/imagebutton3"
android:src="@drawable/button"
android:layout_width = "wrap_content"
android:layout_height = "wrap_content"
android:scaleType = "fitXY"
android:layout_marginLeft = "40px"
android:layout_marginRight = "20px"
android:layout_marginBottom = "50px"
android:layout_weight="1"/>
<ImageButton
android:background = "@android:color/transparent"
android:layout_height="wrap_content"
android:id="@+id/imagebutton4"
android:src="@drawable/button"
android:scaleType = "fitXY"
android:layout_marginLeft = "20px"
android:layout_marginRight = "40px"
android:layout_marginBottom = "50px"
android:layout_width="wrap_content"
android:layout_weight="1"/>
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1">
<ImageButton
android:background = "@android:color/transparent"
android:layout_height="wrap_content"
android:id="@+id/imagebutton5"
android:src="@drawable/button"
android:scaleType = "fitXY"
android:layout_marginLeft = "40px"
android:layout_marginRight = "20px"
android:layout_marginBottom = "50px"
android:layout_width="wrap_content"
android:layout_weight="1"/>
<ImageButton
android:background = "@android:color/transparent"
android:id="@+id/imagebutton6"
android:src="@drawable/button"
android:layout_width = "wrap_content"
android:layout_height = "wrap_content"
android:scaleType = "fitXY"
android:layout_marginLeft = "20px"
android:layout_marginRight = "40px"
android:layout_marginBottom = "50px"
android:layout_weight="1"/>
</LinearLayout>
<TextView
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|bottom"
android:text = "Powered by Alarm.com"
android:textColor = "#000000"
android:background = "@drawable/back" android:layout_width="match_parent"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
Глядя на три слова «LinearLayout», я сделал что-то ужасно неправильно с вашим дизайном пользовательского интерфейса. –