UILabel90度翻转

需要在fixedview上添加两个Label,文字相同只有方向不同

directionPromptLabel1竖直方向
directionPromptLabel2横屏方向

将定义好的directionPromptLabel1赋值给temp然后再做修改
解决方法:将directionPromptLabel1 90度反转之后再定位
//底层view
UIView *fixedview = [[UIView alloc]initWithFrame:CGRectMake(0, 0, SCREENWIDTHTT, SCREENHEIGHT - 80-22)];
UILabel directionPromptLabel1 = [[UILabel alloc]initWithFrame:CGRectMake(0,SCREENHEIGHTTT -124, SCREENWIDTH, 20)];
    directionPromptLabel1.text = NSLocalizedString(@"添加无发票明细 >", nil);
    directionPromptLabel1.textAlignment = NSTextAlignmentCenter;

    directionPromptLabel2 = [[UILabel alloc]initWithFrame:CGRectMake(0,SCREENHEIGHTTT -124, SCREENWIDTH, 20)];
    directionPromptLabel2.text = NSLocalizedString(@"添加无发票明细 >", nil);
    directionPromptLabel2.textAlignment = NSTextAlignmentCenter;
    directionPromptLabel2.transform = CGAffineTransformMakeRotation(M_PI/2);
    directionPromptLabel2.leftL = 30;
    directionPromptLabel2.numberOfLines = 0;
    directionPromptLabel2.centerY = fixedview.centerY;
    
    directionPromptLabel2.textColor = [UIColor whiteColor];
    directionPromptLabel1.textColor = [UIColor whiteColor];
    [fixedview addSubview:directionPromptLabel1];
    [fixedview addSubview:directionPromptLabel2];
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容