Missing/Hidden/Dissappearing Button problem

by Tollas » Sat, 29 May 2010 01:43:20 GMT


Sponsored Links
 <Button
   android:id="@+id/attack_ability_button"
   android:layout_width="52dp"
   android:layout_height="52dp"
   android:layout_x="10dp"
   android:layout_y="70dp"/>

final Button attack_ability_button =
(Button)findViewById(R.id.attack_ability_button);
attack_ability_button.setBackgroundDrawable(getResources().getDrawable(R.drawable.attack_any));


My problem is that when I use the attack_any  drawable to create the
button, it just isn't there.
If I change to another image of the same size, the button shows up
just fine.
I've tried replacing the image file, renaming it, resizing it. Always
with the same results.
I tried using the attack_any drawable for another button and it
disappears as well.
I've also tried moving the button and changing its size, but the
problem persists.
I've even tried drawing the background in XML rather than java and it
still will not show up.

attack_any.png is a 60x60px image 1kb in size.

Scroll View
-----Absolute Layout

--



Missing/Hidden/Dissappearing Button problem

by Justin Anderson » Sat, 29 May 2010 01:58:15 GMT


 Is it there and you just can't see it?  Or is it not there period?  What
happens if you click where the button is supposed to be at?

One other thing I noticed... You are using AbsoluteLayout.  That has been
deprecated and it will not play nice with phones that have different screen
sizes.

----------------------------------------------------------------------
There are only 10 types of people in the world...
Those who know binary and those who don't.
----------------------------------------------------------------------





>


Sponsored Links


Missing/Hidden/Dissappearing Button problem

by Tollas » Sat, 29 May 2010 02:22:40 GMT


 The button is there. I can click on it and it behaves normally.
I have a Spinner onItemSelected that updates the button's image.
When I activate that & set to any value but the default, the button
updates properly and the new image is displayed.




> >



Missing/Hidden/Dissappearing Button problem

by Tollas » Sat, 29 May 2010 04:07:47 GMT


 Yes.
(getResources().getDrawable(R.drawable.attack_any) != null) returns
true.






> > > >



Missing/Hidden/Dissappearing Button problem

by niko20 » Sat, 29 May 2010 21:14:31 GMT


 i,

Are you using a relative layout at all? Relative layout has some bugs
when you use "forward references", and basically will "disappear".

-niko

On May 28, 3:07pm, Tollas <tolla...@gmail.com> wrote:
> > > > >



Missing/Hidden/Dissappearing Button problem

by Tollas » Sun, 30 May 2010 10:14:47 GMT


 o. I have a single AbosoluteLayout nested in a single ScrollView.

<ScrollView
android:id="@+id/scrollview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
xmlns:android="http://schemas.android.com/apk/res/android">

<AbsoluteLayout
android:id="@+id/mainlayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent">

On May 29, 8:14am, niko20 <nikolatesl...@yahoo.com> wrote:
> > > > > >



Missing/Hidden/Dissappearing Button problem

by Tollas » Sat, 05 Jun 2010 14:50:09 GMT


 k. Tried switching to RelativeLayout and I'm still having the same
problem.

On May 30, 2:31am, Justin Anderson <janderson....@gmail.com> wrote:
> > > > > > > >



Missing/Hidden/Dissappearing Button problem

by Tollas » Sun, 06 Jun 2010 00:18:20 GMT


  can't remember why. I tried changing the button size to 60x60 with
the same results.

On Jun 5, 4:06am, Justin Anderson <janderson....@gmail.com> wrote:
> > > > > > > > > >



Missing/Hidden/Dissappearing Button problem

by Tollas » Sun, 06 Jun 2010 00:23:00 GMT


  can't remember why. I tried changing the button size to 60x60 with
the same results.

On Jun 5, 4:06am, Justin Anderson <janderson....@gmail.com> wrote:
> > > > > > > > > >



Missing/Hidden/Dissappearing Button problem

by Gubatron » Sun, 06 Jun 2010 04:48:12 GMT


 Did you try passing the drawable on the Button XML?

... android:background="@drawable/attack_any" />

or you can only obtain the drawable at runtime? (dynamic drawable)




--



Missing/Hidden/Dissappearing Button problem

by Tollas » Sun, 06 Jun 2010 06:55:24 GMT


 Yes, I have tried that. Same result.
I've also tried making it an ImageButton and ImageView with the same
result.





--



Missing/Hidden/Dissappearing Button problem

by Tollas » Mon, 07 Jun 2010 09:11:39 GMT


 I have no idea why, but changing the file name to anything that
doesn't begin with the letter "a" seems to work. I had tried different
file names, but all of them began with a.
I don't have any idea why this would affect anything. I have other
files the same size (both in pixels and in kb) that begin with "a"
that work just fine.

I guess since as a user the file name doesn't matter, it's not that
big of a deal, but it would be nice to know why!






--



Missing/Hidden/Dissappearing Button problem

by Tollas » Mon, 07 Jun 2010 10:23:01 GMT


 And this also broke another image. Fixing that one by changing the
name broke a 3rd image. Fixing that broke a 4th. Changed all 4 image
names and now all work properly.







--



Other Threads

1. Android CTS

Hi,

As am new to cts I don't know what I am doing is correct or not.
I build android 2.2 for beagleboard and start the CTS for this board.
I have android-cts zip and android SDK 2.2.
At cts console I give following command :-
start --plan CTS -p android.graphics.cts.BitmapFactoryTest;

and test got fail and I receive following stuff, in testResult.xml:-
-- testDecodeByteArray1 fail    junit.framework.AssertionFailedError at
android.graphics.cts.BitmapFactoryTest.testDecodeByteArray1(BitmapFactoryTest.java:
116)
-- testDecodeByteArray2 fail    junit.framework.AssertionFailedError at
android.graphics.cts.BitmapFactoryTest.testDecodeByteArray2(BitmapFactoryTest.java:
132)

Can any one guilde me.

-Yogesh

--

2. issues in building GingerBread

Hi All
   i have downloaded the GINGERBREAD source code and tried to build the . as
its given the incompatible errors with 32bit - 64 bit, hence i migrated from
32 bit UBUNTU to 64 BIT UBUNTU. now the real problems started
getting lot of errors
like /usr/bin/ld: skipping incompatible
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../libz.so when searching for -lz
/usr/bin/ld: skipping incompatible
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../libz.a when searching for -lz
/usr/bin/ld: skipping incompatible //usr/lib/libz.so when searching for -lz
/usr/bin/ld: skipping incompatible //usr/lib/libz.a when searching for -lz


my PC supports 64 Bit.
can any one let me know the tool chains that i am missing. currently i
installed the same tool chains as 32bit that earlier i used for FROYO.
BR
Sayiram K N

-- 

3. how to track market search terms

4. how to check phone support torch mode..problem pls solve

5. OpenGL Problem with Sphere Texture Mapping

6. WTPaging : Renner Chen

7. FTP speed is less over obex