в ниже размещенном макете, editText
всегда исправлен до конца, даже если я ограничу его ширину, чтобы быть чем-то вроде 30dp
. Я хочу, чтобы он не растягивался до конца, как можно я делаю такКак ограничить ширину editText
* XML код:
<?xml version="1.0" encoding="utf-8"?>
<TableLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="top|left"
android:orientation="horizontal">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="left|center_vertical"
android:src="@android:drawable/alert_light_frame"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal|center_vertical"
android:text="roll: "/>
<EditText
android:layout_width="30dp"
android:layout_height="wrap_content"
android:gravity="start"
android:hint="E"
android:ems="6"/>
</TableRow>
Да .. его рабочий. Я имею в виду, что ширина фиксируется до 30dp. Только его strectch в высоту, как вы указали андроид: layout_height = "wrap_content". В чем проблема? –