Reputation: 805
As we all know that we can set a drawable_left
on the EditText
using
edittext.setcCompoundDrawablesWithIntrinsicBounds(R.drawable.icon,0,0,0);
Is it possible to set a non editable text say "A" on the left side of the edit text?
Upvotes: 0
Views: 806
Reputation: 2985
You can do this like this (The values are for example):
<RelativeLayout android:layout_width="wrap_content"
android:layout_height="wrap_content">
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="A"
android:layout_marginRight="10dp"/>
<EditText android:layout_width="100dp"
android:layout_height="25dp"
android:id="@+id/editTextView"
android:layout_marginLeft="40dp"/>
</RelativeLayout>
Upvotes: 2