IOS學習之動態添加Button

動態添加Button的效果就是點擊之後,生成一個按鈕,併爲按鈕添加點擊的方法。 1、在xib文件上拖拽添加一個button,標題爲:添加button。 2、按住ctrl鍵拖拽到addbuttonViewController.m文件空白處,生成IBAction,填充代碼後如下: - (IBAction)addButton:(id)sender { CGRect frame = CGRectMake(
相關文章
相關標籤/搜索