android - How to have same height for TextView as for EditText? -


i have view 3 lines, in 1 of them 2 textviews, in other 2 1 textview , 1 edittext. how can have same height lines, , size of textview replaces edittext in 1 line have same size other edittexts?

regards, eddie

example code here: have 2nd textview in first line have same size (of view , of text within it) edittext in following lines.

<linearlayout xmlns:android="http://schemas.android.com/apk/res/android"         android:orientation="vertical"     android:layout_width="fill_parent"     android:layout_height="wrap_content"     > <linearlayout         android:orientation="horizontal"         android:layout_width="fill_parent"         android:layout_height="wrap_content"         >     <textview             android:text="datum:"             android:layout_width="60dip"              android:layout_height="wrap_content"             android:layout_alignparentleft="true"             />     <textview             android:id="@+id/datum"             android:layout_width="fill_parent"              android:layout_height="wrap_content"              android:layout_alignparentright="true"             /> </linearlayout> <linearlayout         android:orientation="horizontal"         android:layout_width="fill_parent"         android:layout_height="wrap_content"         >     <textview             android:text="zweck:"             android:layout_width="60dip"              android:layout_height="wrap_content"             android:layout_alignparentleft="true"             />     <edittext             android:id="@+id/title"             android:layout_width="fill_parent"              android:layout_height="wrap_content"              android:layout_alignparentright="true"             android:inputtype="textnosuggestions"             /> </linearlayout> <linearlayout         android:orientation="horizontal"         android:layout_width="fill_parent"         android:layout_height="wrap_content"         >     <textview             android:text="betrag:"             android:layout_width="60dip"              android:layout_height="wrap_content"             android:layout_alignparentleft="true"             />     <edittext             android:id="@+id/value"             android:layout_width="fill_parent"              android:layout_height="wrap_content"              android:inputtype="numberdecimal|textnosuggestions"             android:layout_alignparentright="true"             /> </linearlayout> 

can post example code?

you can use distinct sizes using android:layout_width="wrap_content" , /or android:width="300dp" (same height). check margins , paddings.

if need more dynamic, might consider android:layout_weight i.e. letting 2 buttons have equal width , fill horizontal space of parent view set: android:layout_width="wrap_content" android_layout:weight="0.5".

edit: seem same size (filling space left description on left). want increase font size of textview?

you use edittext in 3 columns set first android:editable="false".


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -