你好,歡迎來到IOS教程網

 Ios教程網 >> IOS編程開發 >> IOS開發綜合 >> IOSµ¹¼ÆʱÉèÖÃUIButton±êÌâtitleµÄ¶¶¶¯ÎÊÌâ

IOSµ¹¼ÆʱÉèÖÃUIButton±êÌâtitleµÄ¶¶¶¯ÎÊÌâ

編輯:IOS開發綜合

ÀýÈ磬ÔÚ·¢ËÍÑéÖ¤Âëºó£¬button״̬ÐèÒª±äΪdisable£¬Ã¿¸ôÒ»ÃëÏÔʾµ¹¼Æʱʱ¼ä£¬½ö½öÉèÖÃ

[button setTitle:title forState:UIControlStateDisabled]; 

»ò

[button setTitle:title forState:UIControlStateNormal]; 

ÊDz»¹»µÄ£¬°´Å¥»áÒ»ÉÁÒ»ÉÁµÄ¶¶¶¯¡£

ÐèҪͬʱÉèÖãº

button.titleLabel.text = title; 
[button setTitle:title forState:UIControlStateDisabled]; 

»ò

button.titleLabel.text = title; 
[button setTitle:title forState:UIControlStateNormal];

ÒÔÉÏËùÊöÊÇС±à¸ø´ó¼Ò½éÉܵÄIOSµ¹¼ÆʱÉèÖÃUIButton±êÌâtitleµÄ¶¶¶¯ÎÊÌ⣬ϣÍû¶Ô´ó¼ÒÓÐËù°ïÖú£¬Èç¹û´ó¼ÒÓÐÈκÎÒÉÎÊÇë¸øÎÒÁôÑÔ£¬Ð¡±à»á¼°Ê±»Ø¸´´ó¼ÒµÄ¡£ÔÚ´ËÒ²·Ç³£¸Ðл´ó¼Ò¶Ô½Å±¾Ö®¼ÒÍøÕ¾µÄÖ§³Ö£¡

【IOSµ¹¼ÆʱÉèÖÃUIButton±êÌâtitleµÄ¶¶¶¯ÎÊÌâ】的相關資料介紹到這裡,希望對您有所幫助! 提示:不會對讀者因本文所帶來的任何損失負責。如果您支持就請把本站添加至收藏夾哦!

  1. 上一頁:
  2. 下一頁:
蘋果刷機越獄教程| IOS教程問題解答| IOS技巧綜合| IOS7技巧| IOS8教程
Copyright © Ios教程網 All Rights Reserved