Android : Align three control side by side in Android

on Sunday, April 19, 2015


I am new in Android I wanna put controls like this,but I can't:




textview1


edittext1 edittext2 textview2



<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:weightSum = "1.0"
android:orientation="horizontal"
android:background = "#faadadad" >
<TextView
android:layout_width="match_parent"
android:layout_height="44dp"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="Final"
android:id="@+id/textView4"
android:layout_gravity="center_horizontal" />


<LinearLayout android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.8">
<EditText
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft = "2dip"
android:layout_marginTop = "1dip"
android:layout_marginBottom = "1dip"
android:hint="Search Terms" />
</LinearLayout>
<Button android:text = "grade:"
android:layout_width = "0dip"
android:layout_height="wrap_content"
android:layout_weight = "0.2"/>


</LinearLayout>


with above code , edittext1 and edittext2 and textview2 shows out of screen and under the textview1


0 comments:

Post a Comment