intbt wrote: > I am trying to change visibility of a button (Image). > > However this code does not affect the image - any ideas? > > Prevword_btn = (ImageButton) this.findViewById(R.id.prev_btn); > Prevword_btn.setVisibility(View.INVISIBLE); > Nextword_btn = (ImageButton) this.findViewById(R.id.next_btn); > Nextword_btn.setVisibility(View.INVISIBLE);
Those should work. However, they will not take effect until you leave whatever callback you are in (e.g., onCreate() in the activity, onClick() in a button OnClickListener). > Also when I try to set visibility of the Image Button in the xml > layout file (main.xml) I get an error message from this code > > android:visibility="1" > > saying integers are not accepted? Correct. In XML, the values are "visible", "invisible", and "gone". -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy _The Busy Coder's Guide to Android Development_ Version 2.0 Available! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

