加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

如何在iphone sdk中像这样旋转uibutton

发布时间:2020-12-14 18:56:29 所属栏目:百科 来源:网络整理
导读:alt text http://www.freeimagehosting.net/uploads/e2f814743a.jpg 如何在iphone sdk中像这样旋转uibutton ….. 解决方法 如果您有IBOutlet对象. theButton.transform = CGAffineTransformMakeRotation(M_PI / -4); 如果要在视图上创建运行时按钮. - (void)
alt text http://www.freeimagehosting.net/uploads/e2f814743a.jpg

如何在iphone sdk中像这样旋转uibutton …..

解决方法

如果您有IBOutlet对象.

theButton.transform = CGAffineTransformMakeRotation(M_PI / -4);

如果要在视图上创建运行时按钮.

- (void)viewDidLoad {
    [super viewDidLoad];
    UIButton *btn=[UIButton buttonWithType:UIButtonTypeRoundedRect];
    [btn setFrame:CGRectMake(100,100,200,44)];
    btn.transform=CGAffineTransformMakeRotation(M_PI / -4);
    [btn setTitle:@"RakeshBhatt" forState:UIControlStateNormal];
    [self.view addSubview:btn];
}

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读