Really a mystery (to me), maybe a bug?
I got several buttons with changing backgrounds (SIMULATING a GUI with "menus").
Only ONE of the buttons will execute a special PART of my code: changing the height of a "menu" to zero:getLayoutParams().height=0;
I do it this way as I anyway have to change layout size because of various "menus".
Now I can work with:setVisibility(INVISIBLE) [I corrected "-5" to INVISIBLE]
but that's awkward and irritating.
And all this happens because of the buttons' background images (!!!)
If I give that button a different image - the button will NOT work. If I give the "working" image to another button - THAT BUTTON does work. (ALL buttons are of same height etc.)
Here are two lines from R.java:
public static final int strings_xml=0x7f02001c;
public static final int tileview_java=0x7f02001d;
The first one is fine. The second (like 10 others) is NOT.
I am grateful for answers leading to my better understanding of what's wrong with either An开发者_如何学运维droid - or my way of thinking!
Okay, I found part of the answer.
What I didn't tell before (thought it irrelevant) is: I am using gif files.
Just minutes ago I moved content from a "wrong" image into a copy of the "working" one. This seems to have helped - with most files.
BUT there seems to be no difference between "wrong" and "right" ones in respect to file information and Photoshop file information ...
Anybody know if there are known problems here? Maybe with colour palettes??????
EDIT - In the end I used this WORK-AROUND :
I set the button's visibility to INVISIBLE, changed its height and reset it to VISIBLE; works...What are you trying to achieve with this:
setVisibility(-5)
There are only three valid parameters to setVisibility -
public void setVisibility (int visibility)
Since: API Level 1 Set the enabled state of this view.
visibility One of VISIBLE, INVISIBLE, or GONE.
None of these constants equate to -5.
精彩评论