Custom UINavigationController UIToolbar Background Image

前端 未结 4 1769
灰色年华
灰色年华 2021-01-30 07:41

I have an iPhone application using UINavigationController and would like to customize the elements with custom background images. I was able to do this for the

4条回答
  •  青春惊慌失措
    2021-01-30 08:14

    A simple option is to subclass UINavigationBar/UIToolbar and initialize the navigation controller using the method:

    - (instancetype)initWithNavigationBarClass:(Class)navigationBarClass toolbarClass:(Class)toolbarClass

    However, for simple customizations (as background images, shadows, etc.) I would recommend to use the UIAppearance protocol pattern.

提交回复
热议问题