Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save iwill/d22e4795c751cc09fef1c9b8e3dfec12 to your computer and use it in GitHub Desktop.
Save iwill/d22e4795c751cc09fef1c9b8e3dfec12 to your computer and use it in GitHub Desktop.

Revisions

  1. @vinhnx vinhnx revised this gist Aug 3, 2017. 1 changed file with 17 additions and 0 deletions.
    17 changes: 17 additions & 0 deletions remove-bottom-line-navbar.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,6 @@
    > If you just want to use a solid navigation bar color and have set this up in your storyboard, use this code in your `AppDelegate` class to remove the 1 pixel border via the appearance proxy:
    Objective-C
    ```obj-c
    [[UINavigationBar appearance] setBackgroundImage:[[UIImage alloc] init]
    forBarPosition:UIBarPositionAny
    @@ -8,3 +9,19 @@
    [[UINavigationBar appearance] setShadowImage:[[UIImage alloc] init]];
    ```
    Swift 3.x
    ```swift
    UINavigationBar.appearance().shadowImage = UIImage()
    UINavigationBar.appearance().setBackgroundImage(UIImage(), for: .default)
    ```

    **NOTE**: must set `isTransluscent` UINavigationBar instance to `false` to avoid transparent navigation bar; either in storyboard or in code

    ```swift
    navigationController?.navigationBar.isTranslucent = false

    // or

    navigationBar.isTranslucent = false
    ```
  2. @vinhnx vinhnx revised this gist May 7, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion remove-bottom-line-navbar.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    > If you just want to use a solid navigation bar color and have set this up in your storyboard, use this code in your `AppDelegate` class to remove the 1 pixel border via the appearance proxy:
    ```C
    ```obj-c
    [[UINavigationBar appearance] setBackgroundImage:[[UIImage alloc] init]
    forBarPosition:UIBarPositionAny
    barMetrics:UIBarMetricsDefault];
  3. @vinhnx vinhnx revised this gist May 7, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion remove-bottom-line-navbar.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    > If you just want to use a solid navigation bar color and have set this up in your storyboard, use this code in your `AppDelegate` class to remove the 1 pixel border via the appearance proxy:
    ```objc
    ```C
    [[UINavigationBar appearance] setBackgroundImage:[[UIImage alloc] init]
    forBarPosition:UIBarPositionAny
    barMetrics:UIBarMetricsDefault];
  4. @vinhnx vinhnx revised this gist May 7, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion remove-bottom-line-navbar.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    > If you just want to use a solid navigation bar color and have set this up in your storyboard, use this code in your `AppDelegate` class to remove the 1 pixel border via the appearance proxy:
    ```objective-c
    ```objc
    [[UINavigationBar appearance] setBackgroundImage:[[UIImage alloc] init]
    forBarPosition:UIBarPositionAny
    barMetrics:UIBarMetricsDefault];
  5. @vinhnx vinhnx revised this gist May 7, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion remove-bottom-line-navbar.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    > If you just want to use a solid navigation bar color and have set this up in your storyboard, use this code in your `AppDelegate` class to remove the 1 pixel border via the appearance proxy:
    ```bjective-c
    ```objective-c
    [[UINavigationBar appearance] setBackgroundImage:[[UIImage alloc] init]
    forBarPosition:UIBarPositionAny
    barMetrics:UIBarMetricsDefault];
  6. @vinhnx vinhnx revised this gist May 7, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion remove-bottom-line-navbar.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    > If you just want to use a solid navigation bar color and have set this up in your storyboard, use this code in your `AppDelegate` class to remove the 1 pixel border via the appearance proxy:
    ``òbjective-c
    ```bjective-c
    [[UINavigationBar appearance] setBackgroundImage:[[UIImage alloc] init]
    forBarPosition:UIBarPositionAny
    barMetrics:UIBarMetricsDefault];
  7. @vinhnx vinhnx renamed this gist May 7, 2014. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  8. @vinhnx vinhnx created this gist May 7, 2014.
    10 changes: 10 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    > If you just want to use a solid navigation bar color and have set this up in your storyboard, use this code in your `AppDelegate` class to remove the 1 pixel border via the appearance proxy:

    ``òbjective-c
    [[UINavigationBar appearance] setBackgroundImage:[[UIImage alloc] init]
    forBarPosition:UIBarPositionAny
    barMetrics:UIBarMetricsDefault];

    [[UINavigationBar appearance] setShadowImage:[[UIImage alloc] init]];
    ```