iOS7 - Change UINavigationBar border color

后端 未结 15 2068
时光取名叫无心
时光取名叫无心 2020-12-07 14:44

Is it possible to change the grey border-bottom color of the UINavigationBar in iOS7?

I already tried to remove to border, but this is not working:

[         


        
15条回答
  •  盖世英雄少女心
    2020-12-07 15:08

    I'm using RubyMotion with the RedPotion gem, which includes a StandardAppearance class. This is what I did!

    Put this line at the top of your app_delegate.rb, just before the on_load method:

    ApplicationStylesheet.new(nil).application_setup
    

    Then, in your application_stylesheet.rb, put this as the last line in the application_setup method:

    StandardAppearance.apply app.window
    

    And then this is my StandardAppearance class:

    class StandardAppearance
      def self.apply(window)
        Dispatch.once do
    
          UINavigationBar.appearance.tap do |o|
            o.setBackgroundImage(UIImage.alloc.init, forBarMetrics: UIBarMetricsDefault)
            o.shadowImage = UIImage.alloc.init
          end
    
        end
      end
    end
    

提交回复
热议问题