├── NavigationBarSample.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcuserdata │ └── apple.xcuserdatad │ └── xcschemes │ ├── NavigationBarSample.xcscheme │ └── xcschememanagement.plist ├── NavigationBarSample ├── AppDelegate.h ├── AppDelegate.m ├── Base.lproj │ ├── LaunchScreen.xib │ └── Main.storyboard ├── DescriptionView.h ├── DescriptionView.m ├── DescriptionView.xib ├── Images.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── background.imageset │ │ ├── Contents.json │ │ └── background.png │ └── headIcon.imageset │ │ ├── Contents.json │ │ └── headIcon.png ├── Info.plist ├── UINavigationBar+Background.h ├── UINavigationBar+Background.m ├── ViewController.h ├── ViewController.m └── main.m ├── NavigationBarSampleTests ├── Info.plist └── NavigationBarSampleTests.m └── README.md /NavigationBarSample.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 182AC6711BE0ED3700359322 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 182AC6701BE0ED3700359322 /* main.m */; }; 11 | 182AC6741BE0ED3700359322 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 182AC6731BE0ED3700359322 /* AppDelegate.m */; }; 12 | 182AC6771BE0ED3700359322 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 182AC6761BE0ED3700359322 /* ViewController.m */; }; 13 | 182AC67A1BE0ED3700359322 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 182AC6781BE0ED3700359322 /* Main.storyboard */; }; 14 | 182AC67C1BE0ED3700359322 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 182AC67B1BE0ED3700359322 /* Images.xcassets */; }; 15 | 182AC67F1BE0ED3700359322 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 182AC67D1BE0ED3700359322 /* LaunchScreen.xib */; }; 16 | 182AC68B1BE0ED3700359322 /* NavigationBarSampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 182AC68A1BE0ED3700359322 /* NavigationBarSampleTests.m */; }; 17 | 182AC6991BE0EDA200359322 /* DescriptionView.m in Sources */ = {isa = PBXBuildFile; fileRef = 182AC6951BE0EDA200359322 /* DescriptionView.m */; }; 18 | 182AC69A1BE0EDA200359322 /* DescriptionView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 182AC6961BE0EDA200359322 /* DescriptionView.xib */; }; 19 | 182AC69B1BE0EDA200359322 /* UINavigationBar+Background.m in Sources */ = {isa = PBXBuildFile; fileRef = 182AC6981BE0EDA200359322 /* UINavigationBar+Background.m */; }; 20 | /* End PBXBuildFile section */ 21 | 22 | /* Begin PBXContainerItemProxy section */ 23 | 182AC6851BE0ED3700359322 /* PBXContainerItemProxy */ = { 24 | isa = PBXContainerItemProxy; 25 | containerPortal = 182AC6631BE0ED3700359322 /* Project object */; 26 | proxyType = 1; 27 | remoteGlobalIDString = 182AC66A1BE0ED3700359322; 28 | remoteInfo = NavigationBarSample; 29 | }; 30 | /* End PBXContainerItemProxy section */ 31 | 32 | /* Begin PBXFileReference section */ 33 | 182AC66B1BE0ED3700359322 /* NavigationBarSample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = NavigationBarSample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 34 | 182AC66F1BE0ED3700359322 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 35 | 182AC6701BE0ED3700359322 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 36 | 182AC6721BE0ED3700359322 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 37 | 182AC6731BE0ED3700359322 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 38 | 182AC6751BE0ED3700359322 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 39 | 182AC6761BE0ED3700359322 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 40 | 182AC6791BE0ED3700359322 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 41 | 182AC67B1BE0ED3700359322 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 42 | 182AC67E1BE0ED3700359322 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 43 | 182AC6841BE0ED3700359322 /* NavigationBarSampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = NavigationBarSampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 44 | 182AC6891BE0ED3700359322 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 45 | 182AC68A1BE0ED3700359322 /* NavigationBarSampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NavigationBarSampleTests.m; sourceTree = ""; }; 46 | 182AC6941BE0EDA200359322 /* DescriptionView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DescriptionView.h; sourceTree = ""; }; 47 | 182AC6951BE0EDA200359322 /* DescriptionView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DescriptionView.m; sourceTree = ""; }; 48 | 182AC6961BE0EDA200359322 /* DescriptionView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = DescriptionView.xib; sourceTree = ""; }; 49 | 182AC6971BE0EDA200359322 /* UINavigationBar+Background.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UINavigationBar+Background.h"; sourceTree = ""; }; 50 | 182AC6981BE0EDA200359322 /* UINavigationBar+Background.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UINavigationBar+Background.m"; sourceTree = ""; }; 51 | /* End PBXFileReference section */ 52 | 53 | /* Begin PBXFrameworksBuildPhase section */ 54 | 182AC6681BE0ED3700359322 /* Frameworks */ = { 55 | isa = PBXFrameworksBuildPhase; 56 | buildActionMask = 2147483647; 57 | files = ( 58 | ); 59 | runOnlyForDeploymentPostprocessing = 0; 60 | }; 61 | 182AC6811BE0ED3700359322 /* Frameworks */ = { 62 | isa = PBXFrameworksBuildPhase; 63 | buildActionMask = 2147483647; 64 | files = ( 65 | ); 66 | runOnlyForDeploymentPostprocessing = 0; 67 | }; 68 | /* End PBXFrameworksBuildPhase section */ 69 | 70 | /* Begin PBXGroup section */ 71 | 182AC6621BE0ED3700359322 = { 72 | isa = PBXGroup; 73 | children = ( 74 | 182AC66D1BE0ED3700359322 /* NavigationBarSample */, 75 | 182AC6871BE0ED3700359322 /* NavigationBarSampleTests */, 76 | 182AC66C1BE0ED3700359322 /* Products */, 77 | ); 78 | sourceTree = ""; 79 | }; 80 | 182AC66C1BE0ED3700359322 /* Products */ = { 81 | isa = PBXGroup; 82 | children = ( 83 | 182AC66B1BE0ED3700359322 /* NavigationBarSample.app */, 84 | 182AC6841BE0ED3700359322 /* NavigationBarSampleTests.xctest */, 85 | ); 86 | name = Products; 87 | sourceTree = ""; 88 | }; 89 | 182AC66D1BE0ED3700359322 /* NavigationBarSample */ = { 90 | isa = PBXGroup; 91 | children = ( 92 | 182AC6941BE0EDA200359322 /* DescriptionView.h */, 93 | 182AC6951BE0EDA200359322 /* DescriptionView.m */, 94 | 182AC6961BE0EDA200359322 /* DescriptionView.xib */, 95 | 182AC6971BE0EDA200359322 /* UINavigationBar+Background.h */, 96 | 182AC6981BE0EDA200359322 /* UINavigationBar+Background.m */, 97 | 182AC6721BE0ED3700359322 /* AppDelegate.h */, 98 | 182AC6731BE0ED3700359322 /* AppDelegate.m */, 99 | 182AC6751BE0ED3700359322 /* ViewController.h */, 100 | 182AC6761BE0ED3700359322 /* ViewController.m */, 101 | 182AC6781BE0ED3700359322 /* Main.storyboard */, 102 | 182AC67B1BE0ED3700359322 /* Images.xcassets */, 103 | 182AC67D1BE0ED3700359322 /* LaunchScreen.xib */, 104 | 182AC66E1BE0ED3700359322 /* Supporting Files */, 105 | ); 106 | path = NavigationBarSample; 107 | sourceTree = ""; 108 | }; 109 | 182AC66E1BE0ED3700359322 /* Supporting Files */ = { 110 | isa = PBXGroup; 111 | children = ( 112 | 182AC66F1BE0ED3700359322 /* Info.plist */, 113 | 182AC6701BE0ED3700359322 /* main.m */, 114 | ); 115 | name = "Supporting Files"; 116 | sourceTree = ""; 117 | }; 118 | 182AC6871BE0ED3700359322 /* NavigationBarSampleTests */ = { 119 | isa = PBXGroup; 120 | children = ( 121 | 182AC68A1BE0ED3700359322 /* NavigationBarSampleTests.m */, 122 | 182AC6881BE0ED3700359322 /* Supporting Files */, 123 | ); 124 | path = NavigationBarSampleTests; 125 | sourceTree = ""; 126 | }; 127 | 182AC6881BE0ED3700359322 /* Supporting Files */ = { 128 | isa = PBXGroup; 129 | children = ( 130 | 182AC6891BE0ED3700359322 /* Info.plist */, 131 | ); 132 | name = "Supporting Files"; 133 | sourceTree = ""; 134 | }; 135 | /* End PBXGroup section */ 136 | 137 | /* Begin PBXNativeTarget section */ 138 | 182AC66A1BE0ED3700359322 /* NavigationBarSample */ = { 139 | isa = PBXNativeTarget; 140 | buildConfigurationList = 182AC68E1BE0ED3700359322 /* Build configuration list for PBXNativeTarget "NavigationBarSample" */; 141 | buildPhases = ( 142 | 182AC6671BE0ED3700359322 /* Sources */, 143 | 182AC6681BE0ED3700359322 /* Frameworks */, 144 | 182AC6691BE0ED3700359322 /* Resources */, 145 | ); 146 | buildRules = ( 147 | ); 148 | dependencies = ( 149 | ); 150 | name = NavigationBarSample; 151 | productName = NavigationBarSample; 152 | productReference = 182AC66B1BE0ED3700359322 /* NavigationBarSample.app */; 153 | productType = "com.apple.product-type.application"; 154 | }; 155 | 182AC6831BE0ED3700359322 /* NavigationBarSampleTests */ = { 156 | isa = PBXNativeTarget; 157 | buildConfigurationList = 182AC6911BE0ED3700359322 /* Build configuration list for PBXNativeTarget "NavigationBarSampleTests" */; 158 | buildPhases = ( 159 | 182AC6801BE0ED3700359322 /* Sources */, 160 | 182AC6811BE0ED3700359322 /* Frameworks */, 161 | 182AC6821BE0ED3700359322 /* Resources */, 162 | ); 163 | buildRules = ( 164 | ); 165 | dependencies = ( 166 | 182AC6861BE0ED3700359322 /* PBXTargetDependency */, 167 | ); 168 | name = NavigationBarSampleTests; 169 | productName = NavigationBarSampleTests; 170 | productReference = 182AC6841BE0ED3700359322 /* NavigationBarSampleTests.xctest */; 171 | productType = "com.apple.product-type.bundle.unit-test"; 172 | }; 173 | /* End PBXNativeTarget section */ 174 | 175 | /* Begin PBXProject section */ 176 | 182AC6631BE0ED3700359322 /* Project object */ = { 177 | isa = PBXProject; 178 | attributes = { 179 | LastUpgradeCheck = 0640; 180 | ORGANIZATIONNAME = "YiJiang Chen"; 181 | TargetAttributes = { 182 | 182AC66A1BE0ED3700359322 = { 183 | CreatedOnToolsVersion = 6.4; 184 | }; 185 | 182AC6831BE0ED3700359322 = { 186 | CreatedOnToolsVersion = 6.4; 187 | TestTargetID = 182AC66A1BE0ED3700359322; 188 | }; 189 | }; 190 | }; 191 | buildConfigurationList = 182AC6661BE0ED3700359322 /* Build configuration list for PBXProject "NavigationBarSample" */; 192 | compatibilityVersion = "Xcode 3.2"; 193 | developmentRegion = English; 194 | hasScannedForEncodings = 0; 195 | knownRegions = ( 196 | en, 197 | Base, 198 | ); 199 | mainGroup = 182AC6621BE0ED3700359322; 200 | productRefGroup = 182AC66C1BE0ED3700359322 /* Products */; 201 | projectDirPath = ""; 202 | projectRoot = ""; 203 | targets = ( 204 | 182AC66A1BE0ED3700359322 /* NavigationBarSample */, 205 | 182AC6831BE0ED3700359322 /* NavigationBarSampleTests */, 206 | ); 207 | }; 208 | /* End PBXProject section */ 209 | 210 | /* Begin PBXResourcesBuildPhase section */ 211 | 182AC6691BE0ED3700359322 /* Resources */ = { 212 | isa = PBXResourcesBuildPhase; 213 | buildActionMask = 2147483647; 214 | files = ( 215 | 182AC67A1BE0ED3700359322 /* Main.storyboard in Resources */, 216 | 182AC67F1BE0ED3700359322 /* LaunchScreen.xib in Resources */, 217 | 182AC67C1BE0ED3700359322 /* Images.xcassets in Resources */, 218 | 182AC69A1BE0EDA200359322 /* DescriptionView.xib in Resources */, 219 | ); 220 | runOnlyForDeploymentPostprocessing = 0; 221 | }; 222 | 182AC6821BE0ED3700359322 /* Resources */ = { 223 | isa = PBXResourcesBuildPhase; 224 | buildActionMask = 2147483647; 225 | files = ( 226 | ); 227 | runOnlyForDeploymentPostprocessing = 0; 228 | }; 229 | /* End PBXResourcesBuildPhase section */ 230 | 231 | /* Begin PBXSourcesBuildPhase section */ 232 | 182AC6671BE0ED3700359322 /* Sources */ = { 233 | isa = PBXSourcesBuildPhase; 234 | buildActionMask = 2147483647; 235 | files = ( 236 | 182AC6771BE0ED3700359322 /* ViewController.m in Sources */, 237 | 182AC6741BE0ED3700359322 /* AppDelegate.m in Sources */, 238 | 182AC6711BE0ED3700359322 /* main.m in Sources */, 239 | 182AC69B1BE0EDA200359322 /* UINavigationBar+Background.m in Sources */, 240 | 182AC6991BE0EDA200359322 /* DescriptionView.m in Sources */, 241 | ); 242 | runOnlyForDeploymentPostprocessing = 0; 243 | }; 244 | 182AC6801BE0ED3700359322 /* Sources */ = { 245 | isa = PBXSourcesBuildPhase; 246 | buildActionMask = 2147483647; 247 | files = ( 248 | 182AC68B1BE0ED3700359322 /* NavigationBarSampleTests.m in Sources */, 249 | ); 250 | runOnlyForDeploymentPostprocessing = 0; 251 | }; 252 | /* End PBXSourcesBuildPhase section */ 253 | 254 | /* Begin PBXTargetDependency section */ 255 | 182AC6861BE0ED3700359322 /* PBXTargetDependency */ = { 256 | isa = PBXTargetDependency; 257 | target = 182AC66A1BE0ED3700359322 /* NavigationBarSample */; 258 | targetProxy = 182AC6851BE0ED3700359322 /* PBXContainerItemProxy */; 259 | }; 260 | /* End PBXTargetDependency section */ 261 | 262 | /* Begin PBXVariantGroup section */ 263 | 182AC6781BE0ED3700359322 /* Main.storyboard */ = { 264 | isa = PBXVariantGroup; 265 | children = ( 266 | 182AC6791BE0ED3700359322 /* Base */, 267 | ); 268 | name = Main.storyboard; 269 | sourceTree = ""; 270 | }; 271 | 182AC67D1BE0ED3700359322 /* LaunchScreen.xib */ = { 272 | isa = PBXVariantGroup; 273 | children = ( 274 | 182AC67E1BE0ED3700359322 /* Base */, 275 | ); 276 | name = LaunchScreen.xib; 277 | sourceTree = ""; 278 | }; 279 | /* End PBXVariantGroup section */ 280 | 281 | /* Begin XCBuildConfiguration section */ 282 | 182AC68C1BE0ED3700359322 /* Debug */ = { 283 | isa = XCBuildConfiguration; 284 | buildSettings = { 285 | ALWAYS_SEARCH_USER_PATHS = NO; 286 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 287 | CLANG_CXX_LIBRARY = "libc++"; 288 | CLANG_ENABLE_MODULES = YES; 289 | CLANG_ENABLE_OBJC_ARC = YES; 290 | CLANG_WARN_BOOL_CONVERSION = YES; 291 | CLANG_WARN_CONSTANT_CONVERSION = YES; 292 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 293 | CLANG_WARN_EMPTY_BODY = YES; 294 | CLANG_WARN_ENUM_CONVERSION = YES; 295 | CLANG_WARN_INT_CONVERSION = YES; 296 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 297 | CLANG_WARN_UNREACHABLE_CODE = YES; 298 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 299 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 300 | COPY_PHASE_STRIP = NO; 301 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 302 | ENABLE_STRICT_OBJC_MSGSEND = YES; 303 | GCC_C_LANGUAGE_STANDARD = gnu99; 304 | GCC_DYNAMIC_NO_PIC = NO; 305 | GCC_NO_COMMON_BLOCKS = YES; 306 | GCC_OPTIMIZATION_LEVEL = 0; 307 | GCC_PREPROCESSOR_DEFINITIONS = ( 308 | "DEBUG=1", 309 | "$(inherited)", 310 | ); 311 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 312 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 313 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 314 | GCC_WARN_UNDECLARED_SELECTOR = YES; 315 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 316 | GCC_WARN_UNUSED_FUNCTION = YES; 317 | GCC_WARN_UNUSED_VARIABLE = YES; 318 | IPHONEOS_DEPLOYMENT_TARGET = 8.4; 319 | MTL_ENABLE_DEBUG_INFO = YES; 320 | ONLY_ACTIVE_ARCH = YES; 321 | SDKROOT = iphoneos; 322 | TARGETED_DEVICE_FAMILY = "1,2"; 323 | }; 324 | name = Debug; 325 | }; 326 | 182AC68D1BE0ED3700359322 /* Release */ = { 327 | isa = XCBuildConfiguration; 328 | buildSettings = { 329 | ALWAYS_SEARCH_USER_PATHS = NO; 330 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 331 | CLANG_CXX_LIBRARY = "libc++"; 332 | CLANG_ENABLE_MODULES = YES; 333 | CLANG_ENABLE_OBJC_ARC = YES; 334 | CLANG_WARN_BOOL_CONVERSION = YES; 335 | CLANG_WARN_CONSTANT_CONVERSION = YES; 336 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 337 | CLANG_WARN_EMPTY_BODY = YES; 338 | CLANG_WARN_ENUM_CONVERSION = YES; 339 | CLANG_WARN_INT_CONVERSION = YES; 340 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 341 | CLANG_WARN_UNREACHABLE_CODE = YES; 342 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 343 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 344 | COPY_PHASE_STRIP = NO; 345 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 346 | ENABLE_NS_ASSERTIONS = NO; 347 | ENABLE_STRICT_OBJC_MSGSEND = YES; 348 | GCC_C_LANGUAGE_STANDARD = gnu99; 349 | GCC_NO_COMMON_BLOCKS = YES; 350 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 351 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 352 | GCC_WARN_UNDECLARED_SELECTOR = YES; 353 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 354 | GCC_WARN_UNUSED_FUNCTION = YES; 355 | GCC_WARN_UNUSED_VARIABLE = YES; 356 | IPHONEOS_DEPLOYMENT_TARGET = 8.4; 357 | MTL_ENABLE_DEBUG_INFO = NO; 358 | SDKROOT = iphoneos; 359 | TARGETED_DEVICE_FAMILY = "1,2"; 360 | VALIDATE_PRODUCT = YES; 361 | }; 362 | name = Release; 363 | }; 364 | 182AC68F1BE0ED3700359322 /* Debug */ = { 365 | isa = XCBuildConfiguration; 366 | buildSettings = { 367 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 368 | INFOPLIST_FILE = NavigationBarSample/Info.plist; 369 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 370 | PRODUCT_NAME = "$(TARGET_NAME)"; 371 | }; 372 | name = Debug; 373 | }; 374 | 182AC6901BE0ED3700359322 /* Release */ = { 375 | isa = XCBuildConfiguration; 376 | buildSettings = { 377 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 378 | INFOPLIST_FILE = NavigationBarSample/Info.plist; 379 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 380 | PRODUCT_NAME = "$(TARGET_NAME)"; 381 | }; 382 | name = Release; 383 | }; 384 | 182AC6921BE0ED3700359322 /* Debug */ = { 385 | isa = XCBuildConfiguration; 386 | buildSettings = { 387 | BUNDLE_LOADER = "$(TEST_HOST)"; 388 | FRAMEWORK_SEARCH_PATHS = ( 389 | "$(SDKROOT)/Developer/Library/Frameworks", 390 | "$(inherited)", 391 | ); 392 | GCC_PREPROCESSOR_DEFINITIONS = ( 393 | "DEBUG=1", 394 | "$(inherited)", 395 | ); 396 | INFOPLIST_FILE = NavigationBarSampleTests/Info.plist; 397 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 398 | PRODUCT_NAME = "$(TARGET_NAME)"; 399 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/NavigationBarSample.app/NavigationBarSample"; 400 | }; 401 | name = Debug; 402 | }; 403 | 182AC6931BE0ED3700359322 /* Release */ = { 404 | isa = XCBuildConfiguration; 405 | buildSettings = { 406 | BUNDLE_LOADER = "$(TEST_HOST)"; 407 | FRAMEWORK_SEARCH_PATHS = ( 408 | "$(SDKROOT)/Developer/Library/Frameworks", 409 | "$(inherited)", 410 | ); 411 | INFOPLIST_FILE = NavigationBarSampleTests/Info.plist; 412 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 413 | PRODUCT_NAME = "$(TARGET_NAME)"; 414 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/NavigationBarSample.app/NavigationBarSample"; 415 | }; 416 | name = Release; 417 | }; 418 | /* End XCBuildConfiguration section */ 419 | 420 | /* Begin XCConfigurationList section */ 421 | 182AC6661BE0ED3700359322 /* Build configuration list for PBXProject "NavigationBarSample" */ = { 422 | isa = XCConfigurationList; 423 | buildConfigurations = ( 424 | 182AC68C1BE0ED3700359322 /* Debug */, 425 | 182AC68D1BE0ED3700359322 /* Release */, 426 | ); 427 | defaultConfigurationIsVisible = 0; 428 | defaultConfigurationName = Release; 429 | }; 430 | 182AC68E1BE0ED3700359322 /* Build configuration list for PBXNativeTarget "NavigationBarSample" */ = { 431 | isa = XCConfigurationList; 432 | buildConfigurations = ( 433 | 182AC68F1BE0ED3700359322 /* Debug */, 434 | 182AC6901BE0ED3700359322 /* Release */, 435 | ); 436 | defaultConfigurationIsVisible = 0; 437 | }; 438 | 182AC6911BE0ED3700359322 /* Build configuration list for PBXNativeTarget "NavigationBarSampleTests" */ = { 439 | isa = XCConfigurationList; 440 | buildConfigurations = ( 441 | 182AC6921BE0ED3700359322 /* Debug */, 442 | 182AC6931BE0ED3700359322 /* Release */, 443 | ); 444 | defaultConfigurationIsVisible = 0; 445 | }; 446 | /* End XCConfigurationList section */ 447 | }; 448 | rootObject = 182AC6631BE0ED3700359322 /* Project object */; 449 | } 450 | -------------------------------------------------------------------------------- /NavigationBarSample.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /NavigationBarSample.xcodeproj/xcuserdata/apple.xcuserdatad/xcschemes/NavigationBarSample.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 44 | 45 | 47 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 65 | 66 | 75 | 77 | 83 | 84 | 85 | 86 | 87 | 88 | 94 | 96 | 102 | 103 | 104 | 105 | 107 | 108 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /NavigationBarSample.xcodeproj/xcuserdata/apple.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | NavigationBarSample.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 182AC66A1BE0ED3700359322 16 | 17 | primary 18 | 19 | 20 | 182AC6831BE0ED3700359322 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /NavigationBarSample/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // NavigationBarSample 4 | // 5 | // Created by Apple on 15/10/28. 6 | // Copyright (c) 2015年 YiJiang Chen. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /NavigationBarSample/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // NavigationBarSample 4 | // 5 | // Created by Apple on 15/10/28. 6 | // Copyright (c) 2015年 YiJiang Chen. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | - (void)applicationWillResignActive:(UIApplication *)application { 24 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 25 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 26 | } 27 | 28 | - (void)applicationDidEnterBackground:(UIApplication *)application { 29 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 31 | } 32 | 33 | - (void)applicationWillEnterForeground:(UIApplication *)application { 34 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 35 | } 36 | 37 | - (void)applicationDidBecomeActive:(UIApplication *)application { 38 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application { 42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /NavigationBarSample/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 20 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /NavigationBarSample/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /NavigationBarSample/DescriptionView.h: -------------------------------------------------------------------------------- 1 | // 2 | // DescriptionView.h 3 | // CustomNavicationController 4 | // 5 | // Created by YiJiang Chen on 15/10/27. 6 | // Copyright (c) 2015年 YiJiang Chen. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DescriptionView : UIView 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /NavigationBarSample/DescriptionView.m: -------------------------------------------------------------------------------- 1 | // 2 | // DescriptionView.m 3 | // CustomNavicationController 4 | // 5 | // Created by YiJiang Chen on 15/10/27. 6 | // Copyright (c) 2015年 YiJiang Chen. All rights reserved. 7 | // 8 | 9 | #import "DescriptionView.h" 10 | 11 | @interface DescriptionView() 12 | @property (weak, nonatomic) IBOutlet UIImageView *icon; 13 | @end 14 | 15 | @implementation DescriptionView 16 | 17 | - (void)awakeFromNib 18 | { 19 | [super awakeFromNib]; 20 | } 21 | 22 | - (id)initWithCoder:(NSCoder *)aDecoder 23 | { 24 | self = [super initWithCoder:aDecoder]; 25 | if (self) 26 | { 27 | } 28 | 29 | return self; 30 | } 31 | 32 | 33 | // Only override drawRect: if you perform custom drawing. 34 | // An empty implementation adversely affects performance during animation. 35 | - (void)drawRect:(CGRect)rect { 36 | // Drawing code 37 | _icon.layer.cornerRadius = 21; 38 | _icon.layer.masksToBounds = YES; 39 | } 40 | 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /NavigationBarSample/DescriptionView.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /NavigationBarSample/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /NavigationBarSample/Images.xcassets/background.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "background.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /NavigationBarSample/Images.xcassets/background.imageset/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aqiejiao/NavigationBarSample/38e2363610ffc09f65ed32b55b2db7481684b391/NavigationBarSample/Images.xcassets/background.imageset/background.png -------------------------------------------------------------------------------- /NavigationBarSample/Images.xcassets/headIcon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x", 6 | "filename" : "headIcon.png" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /NavigationBarSample/Images.xcassets/headIcon.imageset/headIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aqiejiao/NavigationBarSample/38e2363610ffc09f65ed32b55b2db7481684b391/NavigationBarSample/Images.xcassets/headIcon.imageset/headIcon.png -------------------------------------------------------------------------------- /NavigationBarSample/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | YiJiang-Chen.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /NavigationBarSample/UINavigationBar+Background.h: -------------------------------------------------------------------------------- 1 | // 2 | // UINavigationBar+Background.h 3 | // CustomNavicationController 4 | // 5 | // Created by YiJiang Chen on 15/10/22. 6 | // Copyright (c) 2015年 YiJiang Chen. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UINavigationBar (Background) 12 | - (void)cnSetBackgroundColor:(UIColor *)backgroundColor; 13 | - (void)cnReset; 14 | @end 15 | -------------------------------------------------------------------------------- /NavigationBarSample/UINavigationBar+Background.m: -------------------------------------------------------------------------------- 1 | // 2 | // UINavigationBar+Background.m 3 | // CustomNavicationController 4 | // 5 | // Created by YiJiang Chen on 15/10/22. 6 | // Copyright (c) 2015年 YiJiang Chen. All rights reserved. 7 | // 8 | #import 9 | #import "UINavigationBar+Background.h" 10 | 11 | @implementation UINavigationBar (Background) 12 | static char overlayKey; 13 | 14 | - (UIView *)overlay 15 | { 16 | return objc_getAssociatedObject(self, &overlayKey); 17 | } 18 | 19 | - (void)setOverlay:(UIView *)overlay 20 | { 21 | objc_setAssociatedObject(self, &overlayKey, overlay, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 22 | } 23 | 24 | - (void)cnSetBackgroundColor:(UIColor *)backgroundColor 25 | { 26 | if (!self.overlay) { 27 | [self setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault]; 28 | self.overlay = [[UIView alloc] initWithFrame:CGRectMake(0, -20, [UIScreen mainScreen].bounds.size.width, CGRectGetHeight(self.bounds) + 20)]; 29 | self.overlay.userInteractionEnabled = NO; 30 | self.overlay.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight; 31 | [self insertSubview:self.overlay atIndex:0]; 32 | } 33 | 34 | self.overlay.backgroundColor = backgroundColor; 35 | } 36 | 37 | - (void)cnReset 38 | { 39 | [self setBackgroundImage:nil forBarMetrics:UIBarMetricsDefault]; 40 | [self.overlay removeFromSuperview]; 41 | self.overlay = nil; 42 | } 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /NavigationBarSample/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // CustomNavicationController 4 | // 5 | // Created by YiJiang Chen on 15/10/21. 6 | // Copyright (c) 2015年 YiJiang Chen. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /NavigationBarSample/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // CustomNavicationController 4 | // 5 | // Created by YiJiang Chen on 15/10/21. 6 | // Copyright (c) 2015年 YiJiang Chen. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "UINavigationBar+Background.h" 11 | #import "DescriptionView.h" 12 | 13 | #define kScreenHeight CGRectGetHeight([UIScreen mainScreen].bounds) 14 | 15 | @interface ViewController () 16 | @property (weak, nonatomic) IBOutlet UITableView *tableView; 17 | @property (nonatomic) CGFloat halfHeight; 18 | @property (nonatomic, strong) DescriptionView *descriptionView; 19 | @end 20 | 21 | @implementation ViewController 22 | 23 | - (void)viewDidLoad { 24 | [super viewDidLoad]; 25 | // Do any additional setup after loading the view, typically from a nib. 26 | // [self.navigationController.navigationBar cnSetBackgroundColor:[UIColor clearColor]]; 27 | //替换这种方式 28 | UIColor *color = [UIColor colorWithRed:45/255.0 green:45/255.0 blue:45/255.0 alpha:1]; 29 | self.navigationController.navigationBar.barTintColor = color; 30 | //---end--- 31 | 32 | [_tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"CustomCell"]; 33 | _tableView.backgroundView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"background"]]; 34 | //_tableView.rowHeight = 90; 35 | //CGFloat screenHeight = CGRectGetHeight([UIScreen mainScreen].bounds); 36 | _halfHeight = (kScreenHeight) * 0.5 - 64; 37 | [_tableView setContentInset:UIEdgeInsetsMake(_halfHeight, 0, 0, 0)]; 38 | 39 | _descriptionView = [[NSBundle mainBundle] loadNibNamed:@"DescriptionView" owner:nil options:nil][0]; 40 | _descriptionView.frame = CGRectMake(0, 64, CGRectGetWidth([UIScreen mainScreen].bounds), 42); 41 | //[[DescriptionView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth([UIScreen mainScreen].bounds), 42)]; 42 | [self.view addSubview:_descriptionView]; 43 | } 44 | 45 | - (void)viewWillAppear:(BOOL)animated 46 | { 47 | [super viewWillAppear:YES]; 48 | self.navigationController.navigationBar.barStyle = UIBarStyleBlack;//导航栏的背景色是黑色, 字体为白色 49 | [self scrollViewDidScroll:self.tableView]; 50 | [self.navigationController.navigationBar setShadowImage:[UIImage new]];//用于去除导航栏的底线,也就是周围的边线 51 | } 52 | 53 | - (void)viewWillDisappear:(BOOL)animated 54 | { 55 | [super viewWillDisappear:animated]; 56 | self.tableView.delegate = nil; 57 | [self.navigationController.navigationBar cnReset]; 58 | } 59 | 60 | - (void)didReceiveMemoryWarning { 61 | [super didReceiveMemoryWarning]; 62 | // Dispose of any resources that can be recreated. 63 | } 64 | 65 | #pragma mark UIScrollViewDelegate 66 | - (void)scrollViewDidScroll:(UIScrollView *)scrollView 67 | { 68 | UIColor *color = [UIColor colorWithRed:45/255.0 green:45/255.0 blue:45/255.0 alpha:1]; 69 | CGFloat offsetY = scrollView.contentOffset.y; 70 | if (offsetY >= - _halfHeight - 64) { 71 | CGFloat alpha = MIN(1, (_halfHeight + 64 + offsetY)/_halfHeight); 72 | //[self.navigationController.navigationBar cnSetBackgroundColor:[color colorWithAlphaComponent:alpha]]; 73 | //替换这种方式 74 | [[[self.navigationController.navigationBar subviews] objectAtIndex:0] setAlpha:alpha]; 75 | //---end--- 76 | _descriptionView.alpha = 1 - alpha; 77 | } else { 78 | //[self.navigationController.navigationBar cnSetBackgroundColor:[color colorWithAlphaComponent:0]]; 79 | //替换这种方式 80 | [[[self.navigationController.navigationBar subviews] objectAtIndex:0] setAlpha:0]; 81 | //---end--- 82 | } 83 | } 84 | 85 | #pragma mark UITableViewDatasource 86 | 87 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 88 | { 89 | return 5; 90 | } 91 | 92 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView 93 | { 94 | return 2; 95 | } 96 | 97 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 98 | { 99 | static NSString *CellIdentifier = @"CustomCell"; 100 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath]; 101 | cell.textLabel.text = @"text"; 102 | return cell; 103 | } 104 | 105 | //- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath 106 | //{ 107 | // return 65; 108 | //} 109 | 110 | @end 111 | -------------------------------------------------------------------------------- /NavigationBarSample/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // NavigationBarSample 4 | // 5 | // Created by Apple on 15/10/28. 6 | // Copyright (c) 2015年 YiJiang Chen. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /NavigationBarSampleTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | YiJiang-Chen.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /NavigationBarSampleTests/NavigationBarSampleTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // NavigationBarSampleTests.m 3 | // NavigationBarSampleTests 4 | // 5 | // Created by Apple on 15/10/28. 6 | // Copyright (c) 2015年 YiJiang Chen. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface NavigationBarSampleTests : XCTestCase 13 | 14 | @end 15 | 16 | @implementation NavigationBarSampleTests 17 | 18 | - (void)setUp { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown { 24 | // Put teardown code here. This method is called after the invocation of each test method in the class. 25 | [super tearDown]; 26 | } 27 | 28 | - (void)testExample { 29 | // This is an example of a functional test case. 30 | XCTAssert(YES, @"Pass"); 31 | } 32 | 33 | - (void)testPerformanceExample { 34 | // This is an example of a performance test case. 35 | [self measureBlock:^{ 36 | // Put the code you want to measure the time of here. 37 | }]; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # NavigationBarSample 2 | 滑动ScrollView时,NavicationBar的背景色的透明度发生相应变化。 3 | 详情见[文章](http://www.jianshu.com/p/f8be0766c7f7) 4 | --------------------------------------------------------------------------------