0

I am very new to xml codings. I normally use android's graphical layout tools to design my views. But now I am facing problems designing the customized xml views. Below is an image of the design I'd like. Please suggest how can i design that. The space in between the different boxes also needs to be considered. If you can provide some xml code for this, it will be very helpful to me.

enter image description here

1
  • you want to horizontal scroll view or simple Oct 15, 2011 at 5:52

1 Answer 1

2
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:orientation="vertical"
  android:layout_width="match_parent"
  android:layout_height="match_parent">
    <ScrollView android:layout_height="wrap_content" android:id="@+id/scrollView1" android:layout_width="match_parent">
        <LinearLayout android:id="@+id/linearLayout1" android:layout_width="match_parent" android:layout_height="match_parent">
            <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="My Text View" android:id="@+id/textView1" android:textAppearance="?android:attr/textAppearanceLarge"></TextView>


        </LinearLayout>
    </ScrollView>
    <LinearLayout android:layout_height="wrap_content" android:id="@+id/linearLayout2" android:layout_width="match_parent" android:orientation="horizontal">
    <LinearLayout android:layout_height="wrap_content" android:id="@+id/linearLayout3" android:layout_weight="1" android:layout_width="fill_parent" android:orientation="vertical">
        <ImageButton android:layout_height="wrap_content" android:id="@+id/imageButton1" android:src="@drawable/icon" android:layout_width="fill_parent"></ImageButton>
        <ImageView android:id="@+id/imageView1" android:layout_height="wrap_content" android:src="@drawable/icon" android:layout_width="fill_parent"></ImageView>
    </LinearLayout>
    <EditText android:layout_width="fill_parent" android:layout_weight="1" android:text="abcdef" android:layout_height="wrap_content" android:id="@+id/editText1" android:inputType="textMultiLine">
        <requestFocus></requestFocus>
    </EditText>
    </LinearLayout>

</LinearLayout>

Adjust parameters according your need

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.