Reputation: 15
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>
Upvotes: 0
Views: 53
Reputation: 14398
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>
Upvotes: 1