mirror of
https://github.com/status-im/react-native.git
synced 2025-02-19 04:46:48 +00:00
Summary: For the current project I am working on I needed to add a boolean option (`shadowHidden`) to remove the 1px hairline shadow from the NavigationIOS component: `<NavigatorIOS shadowHidden={true} initialRoute={...} />` By default, or with `shadowHidden={false}` it looks like this:  Setting the shadow hidden with `shadowHidden={true}` looks like this:  The code it uses to do the actual hiding is... a bit of a hack (*I* think), but it's the only way currently to do it, and is the way they do it in the iPhone calendar app: iterating through the subviews and removing the shadow image. This removes the shadow *and* keeps the translucent blurry effect with a ScrollView (see this [SO discussion](http://stackoverflow.com/questions/18160173/how-to-remove-uinavigationbar-inner Closes https://github.com/facebook/react-native/pull/1615 Github Author: Mr Speaker <mrspeaker@gmail.com>
43 lines
1.1 KiB
Objective-C
43 lines
1.1 KiB
Objective-C
/**
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*/
|
|
|
|
#import "RCTNavItemManager.h"
|
|
|
|
#import "RCTConvert.h"
|
|
#import "RCTNavItem.h"
|
|
|
|
@implementation RCTNavItemManager
|
|
|
|
RCT_EXPORT_MODULE()
|
|
|
|
- (UIView *)view
|
|
{
|
|
return [[RCTNavItem alloc] init];
|
|
}
|
|
|
|
RCT_EXPORT_VIEW_PROPERTY(navigationBarHidden, BOOL)
|
|
RCT_EXPORT_VIEW_PROPERTY(shadowHidden, BOOL)
|
|
RCT_EXPORT_VIEW_PROPERTY(tintColor, UIColor)
|
|
RCT_EXPORT_VIEW_PROPERTY(barTintColor, UIColor)
|
|
RCT_EXPORT_VIEW_PROPERTY(translucent, BOOL)
|
|
|
|
RCT_EXPORT_VIEW_PROPERTY(title, NSString)
|
|
RCT_EXPORT_VIEW_PROPERTY(titleTextColor, UIColor)
|
|
|
|
RCT_EXPORT_VIEW_PROPERTY(backButtonIcon, UIImage)
|
|
RCT_EXPORT_VIEW_PROPERTY(backButtonTitle, NSString)
|
|
|
|
RCT_EXPORT_VIEW_PROPERTY(leftButtonTitle, NSString)
|
|
RCT_EXPORT_VIEW_PROPERTY(leftButtonIcon, UIImage)
|
|
|
|
RCT_EXPORT_VIEW_PROPERTY(rightButtonIcon, UIImage)
|
|
RCT_EXPORT_VIEW_PROPERTY(rightButtonTitle, NSString)
|
|
|
|
@end
|