Reputation: 10148
hi all i have TextView and EditText in my xml but i cannot type in EditText.this my xml code and rounded rectangle background xml code.
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:background="@drawable/rounded_background"
android:layout_marginRight="18dp"
android:layout_marginBottom="10dp"
android:layout_marginTop="20dp"
android:layout_marginLeft="18dip">
<LinearLayout android:layout_width="fill_parent"
android:layout_height="wrap_content" android:orientation="horizontal"
android:paddingLeft="10dp">
<TextView android:text="first" android:textColor="#686868"
android:id="@+id/lable" android:textSize="10sp" android:layout_width="fill_parent"
android:layout_height="wrap_content"
></TextView>
<EditText android:id="@+id/r_email" android:layout_width="fill_parent"
android:layout_height="35dp" android:singleLine="true"
android:inputType="textEmailAddress" android:textSize="15sp"
android:background="@android:color/transparent" android:hint="Initial" />
</LinearLayout>
<View android:layout_width="fill_parent" android:layout_height="1dip"
android:background="#ababab" />
<LinearLayout android:layout_width="fill_parent"
android:layout_height="wrap_content" android:orientation="horizontal"
android:paddingLeft="10dp">
<TextView android:text="middle" android:textColor="#686868"
android:id="@+id/lable" android:textSize="10sp" android:layout_width="fill_parent"
android:layout_height="wrap_content"
></TextView>
<EditText android:id="@+id/r_email" android:layout_width="fill_parent"
android:layout_height="35dp" android:singleLine="true"
android:inputType="textEmailAddress" android:textSize="15sp"
android:background="@android:color/transparent" android:hint="Initial" />
</LinearLayout>
<View android:layout_width="fill_parent" android:layout_height="1dip"
android:background="#ababab" />
<LinearLayout android:layout_width="fill_parent"
android:layout_height="wrap_content" android:orientation="horizontal"
android:paddingLeft="10dp">
<TextView android:text="Last" android:textColor="#686868"
android:id="@+id/lable" android:textSize="10sp" android:layout_width="fill_parent"
android:layout_height="wrap_content"
></TextView>
<EditText android:id="@+id/r_email" android:layout_width="fill_parent"
android:layout_height="35dp" android:singleLine="true"
android:inputType="textEmailAddress" android:textSize="15sp"
android:background="@android:color/transparent" android:hint="Initial" />
</LinearLayout>
<View android:layout_width="fill_parent" android:layout_height="1dip"
android:background="#ababab" />
<LinearLayout android:layout_width="fill_parent"
android:layout_height="wrap_content" android:orientation="horizontal"
android:paddingLeft="10dp">
<TextView android:text="DOB" android:textColor="#686868"
android:id="@+id/lable" android:textSize="10sp" android:layout_width="fill_parent"
android:layout_height="wrap_content"
></TextView>
<EditText android:id="@+id/r_email" android:layout_width="fill_parent"
android:layout_height="35dp" android:singleLine="true"
android:inputType="textEmailAddress" android:textSize="15sp"
android:background="@android:color/transparent" android:hint="Initial" />
</LinearLayout>
<View android:layout_width="fill_parent" android:layout_height="1dip"
android:background="#ababab" />
<LinearLayout android:layout_width="fill_parent"
android:layout_height="wrap_content" android:orientation="horizontal"
android:paddingLeft="10dp">
<TextView android:text="DOR" android:textColor="#686868"
android:id="@+id/lable" android:textSize="10sp" android:layout_width="fill_parent"
android:layout_height="wrap_content"
></TextView>
<EditText android:id="@+id/r_email" android:layout_width="fill_parent"
android:layout_height="35dp" android:singleLine="true"
android:inputType="textEmailAddress" android:textSize="15sp"
android:background="@android:color/transparent" android:hint="Initial" />
</LinearLayout>
</LinearLayout>
rounded rectangle background coding
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#ffffff"/>
<stroke android:width="3dp" color="#ffff8080"/>
<corners
android:radius="15dp"
android:color="#ababab" />
<padding
android:left="10dp"
android:top="10dp"
android:right="10dp"
android:bottom="10dp" />
</shape>
Upvotes: 1
Views: 4157
Reputation: 64399
All your EditText fields have the same ID. That would be the first thing i'd change.
If that doesn't help: remove all extra things just to have a basic textfield, and re-add them to see where the problem is. So start with 1 EditText
like this:
<EditText android:id="@+id/this-is-unique" android:layout_width="fill_parent"
android:layout_height="35dp" />
And work your way up from there.
Edit: try to remove that rounded backgroud also. Just to be sure. Just add one very simple edittext to make sure it is not some other piece of your code doing this. No extra linearlayouts or anything, just make your xml as simple as possible. If it still doesn't work, you know you have to look for something else, if it does, start re-adding your views and settings to find the culprit.
Upvotes: 4