android - How to arrange layouts with many view controls -
i want screen : ![my screen schema][1] [1]: http://i.stack.imgur.com/pbt0i.png how should layout? have given fixed width , height not practice please me in designing screen.
for more details below xml file
<relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="wrap_content" android:layout_height="match_parent" android:background="@android:color/background_light" android:paddingbottom="@dimen/activity_vertical_margin" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_margin" tools:context=".questionbankactivity" > <relativelayout android:id="@+id/linearlayout2" android:layout_width="match_parent" android:layout_height="45dp" android:layout_alignparentleft="true" android:layout_alignparenttop="true" android:layout_margintop="5dp" android:background="@drawable/orangewood" android:gravity="top" android:orientation="horizontal" > <button android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparentbottom="true" android:layout_alignparentleft="true" android:layout_alignparenttop="true" android:layout_marginbottom="3dp" android:layout_marginleft="3dp" android:layout_margintop="3dp" android:background="@drawable/blue_gray_back" android:gravity="center_vertical|center_horizontal" android:padding="5dp" android:paddingtop="1dp" android:text="@string/quespalet" android:textcolor="@android:color/background_light" android:typeface="serif" /> <textview android:id="@+id/textview1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignbaseline="@+id/button1" android:layout_alignbottom="@+id/button1" android:layout_alignparentright="true" android:layout_marginright="22dp" android:padding="5dp" android:textsize="20sp" android:textstyle="bold" android:visibility="invisible" /> <chronometer android:id="@+id/chronometer1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignbaseline="@+id/button1" android:layout_alignbottom="@+id/button1" android:layout_alignparentright="true" android:layout_marginright="22dp" android:padding="5dp" android:textsize="20sp" android:textstyle="bold" android:visibility="invisible" /> <textview android:id="@+id/textview3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centervertical="true" android:layout_torightof="@+id/button1" android:padding="5dp" /> <textview android:id="@+id/textview2" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_alignleft="@+id/textview3" android:layout_alignparentright="true" android:layout_alignparenttop="true" android:layout_marginleft="5dp" android:gravity="center|center_horizontal|center_vertical" android:padding="5dp" android:textcolor="@android:color/background_light" android:textsize="20sp" android:textstyle="bold" /> </relativelayout> <webview android:id="@+id/webview1" android:layout_width="match_parent" android:layout_height="334dp" android:layout_below="@+id/linearlayout2" android:paddingbottom="10dp" android:scrollbars="vertical" /> <linearlayout android:id="@+id/linearlayout3" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignparentbottom="true" android:layout_below="@+id/radiogroup1" android:layout_centerhorizontal="true" android:weightsum="4" android:background="@drawable/orangewood" android:orientation="horizontal" > <button android:id="@+id/reviewbtn" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="2" android:background="@drawable/blue_gray_back" android:gravity="left" android:textcolor="#ffffff" android:typeface="serif" /> <button android:id="@+id/clearbtn" android:layout_width="0dp" android:layout_height="wrap_content" android:background="@drawable/blue_gray_back" android:layout_weight="1" android:textcolor="#ffffff" android:typeface="serif" /> <button android:id="@+id/savenextbtn" android:layout_width="0dp" android:layout_height="wrap_content" android:background="@drawable/blue_gray_back" android:layout_weight="1" android:gravity="left" android:textcolor="#ffffff" android:typeface="serif" /> </linearlayout> <radiogroup android:id="@+id/radiogroup1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/webview1" android:layout_alignparentleft="true" android:layout_alignparentright="true" android:orientation="horizontal" android:weightsum="4" > <radiobutton android:id="@+id/radio0" android:layout_marginleft="" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:textsize="20sp" android:gravity="fill_vertical" android:textstyle="bold" android:textcolor="#000000" android:button="@drawable/custom_radio" /> <radiobutton android:id="@+id/radio1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:button="@drawable/custom_radio" android:textsize="20sp" android:gravity="fill_vertical" android:textstyle="bold" android:textcolor="#000000"/> <radiobutton android:id="@+id/radio2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:button="@drawable/custom_radio" android:textsize="20sp" android:gravity="fill_vertical" android:textstyle="bold" android:textcolor="#000000" /> <radiobutton android:id="@+id/radio3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:button="@drawable/custom_radio" android:textsize="20sp" android:gravity="fill_vertical" android:textstyle="bold" android:layout_weight="1" android:textcolor="#000000" /> </radiogroup> </relativelayout> thanks!! note using scale width of views bad coding because not fit various screens.please correct me if wrong! feel free ask details regarding problem..
its dummy code check , create own :
<?xml version="1.0" encoding="utf-8"?> <linearlayout android:id="@+id/linearlayout1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparentleft="true" android:layout_alignparentright="true" > <button android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:text="button" /> <button android:id="@+id/button2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:text="button" /> </linearlayout> <webview android:id="@+id/webview1" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_above="@+id/linearlayout2" android:layout_alignparentleft="true" android:layout_below="@+id/linearlayout1" /> <linearlayout android:id="@+id/linearlayout3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparentbottom="true" android:layout_alignparentleft="true" android:layout_alignparentright="true" > <button android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:text="button" /> <button android:id="@+id/button2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:text="button" /> <button android:id="@+id/button3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:text="button" /> </linearlayout> <linearlayout android:id="@+id/linearlayout2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_above="@+id/linearlayout3" android:layout_alignparentleft="true" > <radiobutton android:id="@+id/radiobutton1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:text="radiobutton" /> <radiobutton android:id="@+id/radiobutton2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:text="radiobutton" /> <radiobutton android:id="@+id/radiobutton3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:text="radiobutton" /> <radiobutton android:id="@+id/radiobutton4" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:text="radiobutton" /> </linearlayout>
Comments
Post a Comment