UIButton *button = [[UIButton buttonWithType:UIButtonTypeCustom]];
UIImage *image = [UIImage imageNamed:@"xxx.png"];
[button setBackgroundImage:image forState:UIControlStateNormal];
圖片選張圓形的就可以了 如果在xib中拖出來的按鈕,就把Type設為custom,然後在BackImgae裡選張圓形圖片即可
沒有留言:
張貼留言