4
A
回答
1
实现的UIButton是这样的:它使用XIB文件,还可以添加在这个类作为一个子视图
@interface MyNewButton : UIButton{
UILabel* nickNameLabel;
UIImageView* myImageView;
}
@property (nonatomic, retain) UIImageView *myImageView;
@property (nonatomic, retain) UILabel* nickNameLabel;
@end
@implementation MyNewButton
@synthesize myImageView;
@synthesize nickNameLabel;
- (id)initWithFrame:(CGRect)frame
{
myImageView=[[AXSImageView alloc] initWithFrame:CGRectMake(10, 3, 40, 40)];
[self addSubview:myImageView];
nickNameLabel=[[UILabel alloc] initWithFrame:CGRectMake(myImageView.frame.origin.x + myImageView.frame.size.width + 6, 15, 80, 17)];
[self addSubview:nickNameLabel];
}
- (void)drawRect:(CGRect)rect
{
//DO What You Need
}
- (void)dealloc
{
[nickNameLabel release],nickNameLabel=nil;
[myImageView release],myImageView=nil;
[super dealloc];
}
@end
UIView的,你知道什么是平均:)
相关问题
- 1. EXC_BAD_ACCESS自定义UIView与自定义XIB
- 2. 自定义UIButton与图像
- 3. UITableViewCell与自定义UIButton
- 4. 自定义UIButton
- 5. IOS自定义UIButton
- 6. 自定义UIButton iphone
- 7. 自定义UITextField/UIButton
- 8. UIButton自定义类
- 9. 自定义UITableViewCell UIButton
- 10. 与本地通知的自定义UIButton
- 11. 自定义XIB转换?
- 12. TouchDown上的自定义UIButton
- 13. UIButton的自定义绘制
- 14. 自定义的UIButton后
- 15. iPhone UIButton自定义动画
- 16. 自定义UIButton图像iOS
- 17. UIButton的自定义属性
- 18. 不能自定义的UIButton
- 19. 继承自定义的UIButton
- 20. Iphone的自定义UIButton
- 21. UIscrollview中的自定义UIButton
- 22. 自定义UIButton圆角
- 23. 自定义UIButton的影子
- 24. UIButton自定义亮点
- 25. 自定义UIButton很难按
- 26. UITableView与自定义单元格(与.xib)崩溃
- 27. 如何在代码中创建自定义UIButton并在xib中使用它?
- 28. xib文件和自定义构造函数的自定义UITableViewCell
- 29. 在XIB文件中定义的UIButton未实例化
- 30. 从Xib显示自定义视图
http://stackoverflow.com/questions/8014497/interface-builder-tutorial-on-how-to-customize-uibuttons-in-xcode-4-2 – Bala