0

The problem I am having with this code is that when i run it as the background for a text field, the background only shows to the viewer if the text firld is clicked on and the keyboard comes up. how do i make it so the text feild will always show this background? Clicked on or not.

Edit- my second question is this-I want to make a button that brings up a dialogue bot that has the options , Male, Female and it say choose gender as the instructions for the dialogue box. its very simple but i am getting a lot of errors in my code and I am ready to just delete everything I wrote and copy and paste new code into my Java file in android eclipse. Your help is greatly appreciated.

 <item android:state_focused="true">
 <shape> 
 <gradient android:startColor="#D8D8D8"
 android:centerColor="#FFFFFF" android:endColor="#FFFFFF"
 android:angle="90" android:centerX="0.5" android:centerY="0.5" />
 <stroke android:width="1dp" android:color="#6E6E6E" />
 <corners android:radius="7dp" />
 <padding android:left="10dp" android:top="6dp" android:right="10dp"
 android:bottom="6dp"
 />
 </shape>
 </item>
asked Oct 13, 2014 at 12:57

1 Answer 1

1

Remove

android:state_focused="true"

from item tag,i.e. rewrite item tag as

<item>
 <shape> 
 <gradient android:startColor="#D8D8D8"
 android:centerColor="#FFFFFF" android:endColor="#FFFFFF"
 android:angle="90" android:centerX="0.5" android:centerY="0.5" />
 <stroke android:width="1dp" android:color="#6E6E6E" />
 <corners android:radius="7dp" />
 <padding android:left="10dp" android:top="6dp" android:right="10dp"
 android:bottom="6dp"
 />
 </shape>
 </item>
answered Oct 13, 2014 at 12:59
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.