java - LinearLayout on android -
i trying create sign form android application
this xml code
<linearlayout android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center_horizontal" android:orientation="horizontal" > <textview android:id="@+id/mynumber" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="number +961" android:textsize="20sp" android:color="@android:color/white" /> <edittext android:id="@+id/edittextnumber" android:layout_width="wrap_content" android:layout_height="wrap_content" android:hint="number" android:textcolor="#ffffff" /> <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center_vertical" android:orientation="vertical" > <button android:id="@+id/buttoncreateaccount" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_marginbottom="60dp" android:background="@drawable/ic_create" /> </linearlayout> </linearlayout>
if notice first linearlayout has horizontal orientation , gravity (i want both textview , edit text next each others)
after first linear layout want create account button come out
however showing on same line previous edit text , text view
any idea if should change in settings of second linear layout
change this
<linearlayout android:gravity="center_horizontal" android:layout_height="match_parent" android:layout_width="match_parent" android:orientation="vertical"> <linearlayout android:gravity="center_vertical" android:layout_height="wrap_content" android:layout_width="match_parent" android:orientation="horizontal"> <textview android:color="@android:color/white" android:id="@+id/mynumber" android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="number +961" android:textsize="20sp" /> <edittext android:hint="number" android:id="@+id/edittextnumber" android:layout_height="wrap_content" android:layout_width="wrap_content" android:textcolor="#ffffff" /> </linearlayout> <button android:background="@drawable/ic_create" android:id="@+id/buttoncreateaccount" android:layout_height="wrap_content" android:layout_marginbottom="60dp" android:layout_width="fill_parent" /> </linearlayout>
Comments
Post a Comment