Latest 0.0.1
Homepage https://github.com/Natai/FreeNavigationItem
License MIT
Platforms ios 11.0
Authors

sample

特性

  1. 支持自定义返回图片和屏幕边缘的间距
  2. 支持自定义leftBarButtonItems和返回按钮的间距
  3. 支持自定义leftBarButtonItemsrightBarButtonItems和屏幕边缘的间距
  4. 支持自定义leftBarButtonItemsrightBarButtonItems各个 Item 的间距
  5. 支持自定义titleViewleftBarButtonItemsrightBarButtonItems的间距
  6. 支持屏幕旋转

环境要求

  • iOS 11.0+
  • Swift 4.2

安装

Cocoapods

Podfile添加:

pod 'FreeNavigationItem'

使用

开启功能

UINavigationBar.freeNavigationItems()

然后设置相应属性。

全局设置

// UINavigationBar 的相应属性只能全局设置
UINavigationBar.backImageMargin = 0
UINavigationBar.backButtonWidth = 30

UINavigationItem.leftItemsMargin = 0
UINavigationItem.leftItemsSpacing = 0
UINavigationItem.minTitleContentViewMargin = 0
UINavigationItem.rightItemsMargin = 0
UINavigationItem.rightItemsSpacing = 0
UINavigationItem.firstLeftItemToBackSpacing = 0

单个页面指定设置

navigationItem.leftItemsMargin = 10
navigationItem.leftItemsSpacing = 2
navigationItem.minTitleContentViewMargin = 4
navigationItem.rightItemsMargin = 5
navigationItem.rightItemsSpacing = 3
navigationItem.firstLeftItemToBackSpacing = 1

Latest podspec

{
    "name": "FreeNavigationItem",
    "version": "0.0.1",
    "summary": "Set free UIBarButtonItems",
    "homepage": "https://github.com/Natai/FreeNavigationItem",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "natai": ""
    },
    "platforms": {
        "ios": "11.0"
    },
    "swift_version": "4.2",
    "source": {
        "git": "https://github.com/Natai/FreeNavigationItem.git",
        "tag": "0.0.1"
    },
    "source_files": "Source/*.swift"
}

Pin It on Pinterest

Share This