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

后端 未结 3 1321
感情败类
感情败类 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 :)

提交回复
热议问题