How to apply text shadow to UITextView?

前端 未结 7 1060
醉梦人生
醉梦人生 2021-02-06 21:12

Actually I love UILabel. They\'re sweet. Now I had to go to UITextView because UILabel is not aligning text vertically to the top. Damn. O

7条回答
  •  臣服心动
    2021-02-06 21:35

    text.layer.shadowColor = [[UIColor whiteColor] CGColor];
    text.layer.shadowOffset = CGSizeMake(1.0f, 1.0f);
    text.layer.shadowOpacity = 1.0f;
    text.layer.shadowRadius = 1.0f;
    

    And don't forget to add up top:

    #import 
    

提交回复
热议问题