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. Repo Client init problem ubuntu 8.10

I am trying to download the android source onto a new ubuntu 8.10
installation on a x86 machine. All the steps worked fine until I tried
to init the repo client. I get the following...

ja...@james-desktop:~/mydroid$ repo init -u 
git://android.git.kernel.org/platform/manifest.git
Traceback (most recent call last):
  File "/home/james/bin/repo", line 590, in <module>
    main(sys.argv[1:])
  File "/home/james/bin/repo", line 557, in main
    _Init(args)
  File "/home/james/bin/repo", line 176, in _Init
    _CheckGitVersion()
  File "/home/james/bin/repo", line 205, in _CheckGitVersion
    proc = subprocess.Popen(cmd, stdout=subprocess.PIPE)
  File "/usr/lib/python2.5/subprocess.py", line 594, in __init__
    errread, errwrite)
  File "/usr/lib/python2.5/subprocess.py", line 1153, in
_execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

I can't find anyone else having such an repo error. I did find an
obscure message that said the python error might be due to a missing
readline module. I tried to install lib32readline5-dev as in the
download instructions and got the following error

ja...@james-desktop:~$ sudo apt-get install lib32readline5-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Couldn't find package lib32readline5-dev

Any ideas anybody? I am somewhat new to linux but have had a fair
amount of unix experience in the past.


--~--~---------~--~----~------------~-------~--~----~

2. Does one really need to have a data plan with G1 if you use Wifi + voice?

I just spoke with a T-mobile rep and she says that "in order for the
phone to work, you have to have the data plan because without internet
access, you will not even be able to make phone calls because you have
to sign on to your google account to sign into the phone".
So one cannot make voice calls without internet access to first sign
in? that seems really ridiculous to me. Is that accurate? Can anyone
with a G1 and without a data plan verify?

On Mar 10, 1:48pm, "Michael Martin - MM Agency" <mi...@mm-agency.com>


--~--~---------~--~----~------------~-------~--~----~

3. Using JUnit

4. Clarification about system images

5. Ifconfig command in Adb shell

6. Regarding the Network Location provider basic initialization sequence

7. Let the touch events pass through my application, Was it possible?