c# - Programmatically changing button label in Monotouch -


i made .xib button, , referenced outlet "btnacties"

when following (at given time) in back-end c# code

btnacties.titlelabel.text = "this new label!";

when build , run app, label on button changes "this new label", then, if touch button, label reverts 'default' text set in .xib file.

how change label on monotouch uibutton , keep happening?

when want set text on uibutton, not altering text of textlabel property. calling settitle method, passing second argument, button state title set @ runtime. chetan bhalara's answer correct, here c#/monotouch equivalent:

btnacties.settitle ("title", uicontrolstate.normal); 

they way doing right doesn't work, because label's text changing internally whenever needed, title set in interface builder (if have set it), in case when tap button.


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -