Adding Emboss to a UILabel in a navigationItem.titleView (as seen with navigationItem.title)

后端 未结 3 1304
感情败类
感情败类 2020-12-29 17:38

I\'m trying to mimic the default emboss that automatically gets applied to navigationItem.title, as well as many other UIKit controls.

As seen in this screenshot\'s

相关标签:
3条回答
  • 2020-12-29 18:04

    Yeh thanks! I just figured it out:

    where postTitle is set to a white colour, i just added a darkGray shadow with a vertical offset of 1px.

    [postTitle setShadowColor:[UIColor darkGrayColor]];

    [postTitle setShadowOffset:CGSizeMake(0, -1)];

    Looks exactly like anything you'd put in a .title :)

    0 讨论(0)
  • 2020-12-29 18:21

    shadow and shadowOffset are what you're looking for I think. Set those properties on the label and it should do what you want.

    0 讨论(0)
  • 2020-12-29 18:24

    A white shadow and a plus one instead a minus one as offset gives that depressed embossed look.

    0 讨论(0)
提交回复
热议问题