Question

I am new to android, currently. I have created simple EditTexts and search bar type EditText .. But now I am stuck at creating attached EditTexts like in the following snapshot. enter image description here

Was it helpful?

Solution 2

You could use parent LinearLayout view and make it roundtable using shapes (like the other answer). Then just put any number of EditText views and use separator view between them.

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" >
   <solid android:color="#ffffff" />
   <stroke android:width="1dip" android:color="#000000"/>
   <corners android:radius="3dp" />
</shape>

using the following xml code to create a new drawable and set it as background to your LinearLayout that contains EditViews.

OTHER TIPS

for 1st edit text:

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:padding="10dp"
    android:shape="rectangle" >

    <corners android:topLeftRadius="4dp" 
             android:topRightRadius="4dp"  />

    <solid android:color="#fff" />

    <stroke
        android:width="1dp"
        android:color="#777" />

</shape>

second:

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:padding="10dp"
    android:shape="rectangle" >



    <solid android:color="#fff" />

    <stroke
        android:width="1dp"
        android:color="#777" />

</shape>

third:

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:padding="10dp"
    android:shape="rectangle" >

    <corners android:bottomLeftRadius="4dp" 
             android:bottomRightRadius="4dp" />

    <solid android:color="#fff" />

    <stroke
        android:width="1dp"
        android:color="#777" />

</shape>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top