A. iOS系統怎樣在照片中加文字
兩種方式:
先放一個UIImageView,將圖片添加在UIImageView上,然後在UIImageView視圖上再加一個UILable。
整個過程用UIButton來實現,將圖片設置為button的背景,文字設置為title
B. ios 怎麼動態改變 UIButton的title文字
ios中tabbar得title和navigationbar的title修改方法如下: self.tabBarItem.title = [NSString stringWithFormat:@""];//來設置tab的title self.title = @"";//設置navigationbar的title;
C. ios當button載入完成已後,怎麼改變button的文字
如果你用的是IB,選中按鈕在右側屬性界面進行設置:按鈕類型(Type)設置為自定義,BackgroundImage選擇你的圖片,Title內輸入你要顯示的文字 代碼實現的話如下: //按鈕初始化 UIButton *myButton =[UIButton buttonWithType:UIButtonTypeCustom]; (注意此處使用便利構造器初始化的button,不需release) //設置按鈕圖片 [myButton setBackgroundImage:[UIImage imageNamed:@"myPic.png"] forState:UIControlStateNormal]; //設置文字 [myButton setTitle:@"確定" forState:UIControlStateNormal];
D. 怎麼去掉ios6下UIButton的邊框
如果是xib上拖拽的,點擊button,右側第四個檢查器,type選擇custom;如果是代碼創建的UIButton* button = [UIButton buttonWithType:UIButtonTypeCustom];
如果button是文字,
[button setTitle:@"哈哈" forState:UIControlStateNormal];
[button setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
[button setTitleColor:[UIColor whiteColor] forState:UIControlStateHighlighted];
如果是圖片
[button setImage:image1 forState:UIControlStateNormal];
[button setImage:image2 forState:UIControlStateHighlighted];