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. OOT daftar xl unlimited

Mods mohon maaf sebelumnya
Karena masih di jalan blm bisa buka arsip 

Saya kemaren ikut daftar nomer xl untuk bisa internet unlimited yg di gagas 
oleh bos dolly surya 

Tp smp saat ini blm bisa daftar 
Mungkin rekan2 bisa bantu alamat email untuk di japri ke bos siapa lagi ya 
Dulu di milis di share alamat email beliau 

Terimakasih sebelumnya 
Mods mohon maaf sekali lagi , mohon maklum 


** @ndro-id  **

-- 
===============
"Indonesian Android Community [id-android]"

PING'S mobile
Email: sa...@pings-mobile.com  Ph. (021) 96087100
---------------------
Yopie Ratjoen
Email: yo...@ratjoen.com  Ph. 08977726681
--------------------
Gila original
Email: i...@gilaoriginal.com  Ph. (031) 91555898
--------------------

Aturan Jual/Kloteran ID-Android  http://goo.gl/azW7

2. Ask Widget Foursquare

Coba apus,  trus pasang lgi widgetnya....

desire with miui



-- 
===============
"Indonesian Android Community [id-android]"

PING'S mobile
Email: sa...@pings-mobile.com  Ph. (021) 96087100
---------------------
Yopie Ratjoen
Email: yo...@ratjoen.com  Ph. 08977726681
--------------------
Gila original
Email: i...@gilaoriginal.com  Ph. (031) 91555898
--------------------

Aturan Jual/Kloteran ID-Android  http://goo.gl/azW7

3. How to detect that Force Stop was called

4. Bootlace lets you install Froyo on your iPhone without a computer

5. Koran Kompas di androi

6. Opera mobile 10.1 beta Android

7. angry birds