Can I give a UIToolBar a custom background in my iPhone app?

后端 未结 10 1007
误落风尘
误落风尘 2020-12-02 09:00

Is it possible to give a UIToolBar a custom background from an image rather than the usual tinted blue/black fade out?

I\'ve tried giving the view a background and s

10条回答
  •  北荒
    北荒 (楼主)
    2020-12-02 09:27

    UIToolbar inherits from UIView. This just worked for me:

    [topBar insertSubview:[[[UIImageView alloc] initWithImage:[UIImage imageNamed:BAR_BKG_IMG]] autorelease] atIndex:0];
    

提交回复
热议问题