I am new to android. I was creating one sample page in which I need to give the background of page as white. but then, if not focused my edit text was not visible with white background. How could I add border of desired color to my edit text so that it become visible. Apart from that when ever I was pressing enter in edit text box it was adding a new line to it. I want to remove this also. Can any body help me out in this.
Thanks in advance
I am new to android. I was creating one sample page in which I
Share
You can set a drawable for your edittext.
edittext_bg.xml:(put this file in your drawable folder)
then set your edittext’s background as
android:background="@drawable/edittext_bg".But this will remove all default background effect of edittext.You can make a selector for edittext for giving it different background when it is in selected state or normal state.
And you can set
android:singleLine="true"in your edittext tag to prevent it to have multiline in edittext.