UILabel90度翻轉(zhuǎn)

需要在fixedview上添加兩個(gè)Label,文字相同只有方向不同

directionPromptLabel1豎直方向
directionPromptLabel2橫屏方向

將定義好的directionPromptLabel1賦值給temp然后再做修改
解決方法:將directionPromptLabel1 90度反轉(zhuǎn)之后再定位
//底層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(@"添加無(wú)發(fā)票明細(xì) >", nil);
    directionPromptLabel1.textAlignment = NSTextAlignmentCenter;

    directionPromptLabel2 = [[UILabel alloc]initWithFrame:CGRectMake(0,SCREENHEIGHTTT -124, SCREENWIDTH, 20)];
    directionPromptLabel2.text = NSLocalizedString(@"添加無(wú)發(fā)票明細(xì) >", 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];
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • 發(fā)現(xiàn) 關(guān)注 消息 iOS 第三方庫(kù)、插件、知名博客總結(jié) 作者大灰狼的小綿羊哥哥關(guān)注 2017.06.26 09:4...
    肇東周閱讀 15,399評(píng)論 4 61
  • Spring Cloud為開(kāi)發(fā)人員提供了快速構(gòu)建分布式系統(tǒng)中一些常見(jiàn)模式的工具(例如配置管理,服務(wù)發(fā)現(xiàn),斷路器,智...
    卡卡羅2017閱讀 136,578評(píng)論 19 139
  • 曾經(jīng)有人做過(guò)這樣一個(gè)實(shí)驗(yàn),他們將貓鼬放置在農(nóng)田里,意圖是抓老鼠。 可惜事與愿違,老鼠繼續(xù)繁殖,貓鼬繼續(xù)成長(zhǎng)。 明明...
    一只會(huì)說(shuō)話的鹿閱讀 741評(píng)論 0 1
  • 我們總在不停的奔波著,似乎永遠(yuǎn)無(wú)法靠岸, 不是在前進(jìn),就是在前進(jìn)的路上, 偶爾的停歇會(huì)幫助我們更好的遠(yuǎn)航, 都說(shuō)食...
    土雞神話閱讀 293評(píng)論 0 1
  • 感恩我的天使????,昨晚睡太晚,在大清早鬧鈴沒(méi)鬧醒的情況下她叫醒了我,最后兩分鐘趕到單位又開(kāi)始我周而復(fù)始的工作。 下...
    日光傾城52fhx閱讀 354評(píng)論 0 0

友情鏈接更多精彩內(nèi)容