I just started android development, so I have two question in my mind
First, why the size of edit field does not change its
width
.Secondly, what is the meaning of these two lines
android:layout_weight="1.0"
android:ems="50"
When I used in layout form android:layout_weight=
it take value as 0.1
, why ?
On field it take 1.0
, why ?
what is ems
?
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/login_header"
android:gravity="center_horizontal"
android:textSize="30dp" />
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="10dp" >
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/username"
android:textSize="18dp"/>
android:id="@+id/username"
android:layout_width="5dp"
android:layout_height="wrap_content"
android:layout_weight="1.0"
android:ems="50"
android:inputType="text"/ >
android:id="@+id/login"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/login_header"
android:layout_margin="10dp"/>
No comments:
Post a Comment