Android Question How to hide Icon Buttons?

Juzer Hussain

Active Member
Licensed User
Longtime User
Hi All,

I am using icon button which i want to hide/show dynamically.Icon buttons are added thru designer.
If i write btn.visible=false button will hide but even wont work
if i write btn.intialize("btn") : btn.visible=false event will work but btn will not hide.
button is decalred in global.

Am I doing something wrong here?

Pls Remark.

Thanks
Juzer
 

udg

Expert
Licensed User
Longtime User
Hi Juzer,
I'm not sure I understood it completely.
When you add an item (a button here) by the designer you shouldn't initialize it in code.
If in the designer you set the buttons' visibility to false then in your code you should have an "event" tha makes it visibile and finally in the buttons click ebvent you presumably would want to make it unvisible again.
When I say an "ebent" to make the button visibile I intend soemthing in your code, like an edittext having a specifci value, a form with all the fields completed and so on.

I hope the above will be helpful to you.

udg
 
Upvote 0

Juzer Hussain

Active Member
Licensed User
Longtime User
Thanks UDG,

What you have explained is the normal behaviour of views but here its not happening like that.
Simply put
I added a customized button(Icon Button, sorry i forgot earlier) thru designer

btn.visible=false works btn_Click does not work

If I add btn.Initialize("btn")

btn.visible=false does not work btn_Click works


Juzer
 
Upvote 0

Juzer Hussain

Active Member
Licensed User
Longtime User
Got it. I set the EventName property in designer now no need to initialize. Visible property is working now and event also is firing.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
If you do it right; it just will work :)
 
Upvote 0
Top