Wie gebe ich meine EditText-s eine feste Breite. Dies ist mein CodeWie gebe ich einem editText eine feste Breite
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingBottom="4dp" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Date:"
android:layout_weight="0"
android:textColor="#FFBBB3B9" />
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColor="#c91f1f"
android:saveEnabled="true"
android:id="@+id/e1b"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Time:"
android:layout_weight="0"
android:textColor="#FFBBB3B9" />
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:textColor="#c91f1f"
android:id="@+id/e1c"
android:saveEnabled="true"
/>
</LinearLayout>
Ich habe versucht, Attribute android: maxLines und android: maxWidth aber ich habe nicht das Problem lösen konnte.
Danke.
Sie Breite in dp geben kann oder maxEms –
Attribut verwenden http://developer.android.com/intl/es/reference /android/widget/TextView.html#attr_android:ems –
http://stackoverflow.com/questions/4257843/in-android-how-to-create-edittext-of-fixed-width/4258093#4258093 –