Commit ce7d5509 authored by Sandy's avatar Sandy

修改界面效果 以及一些小bug

parent 097973b0
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
@property (nonatomic, strong) NSArray *arrLeft; @property (nonatomic, strong) NSArray *arrLeft;
@property (nonatomic, strong) NSArray *arrRight; @property (nonatomic, strong) NSArray *arrRight;
@property (nonatomic, assign) NSInteger selectedMark; @property (nonatomic, assign) NSInteger selectedMark;
@property (nonatomic, strong) CoverShadowView *viewTopCover;
@property (nonatomic, assign) BOOL isTableOpen; @property (nonatomic, assign) BOOL isTableOpen;
@end @end
@implementation CommodityManagementSortView @implementation CommodityManagementSortView
...@@ -103,8 +104,7 @@ ...@@ -103,8 +104,7 @@
#pragma mark ==============animate============== #pragma mark ==============animate==============
- (void)showTableView { - (void)showTableView {
[self.coverView show]; [self.coverView show];
//self.leftSortAction(YES); [self setOtherUserInteraction:NO];
[self viewController].navigationItem.leftBarButtonItem.enabled = NO;
WS(weakSelf) WS(weakSelf)
self.isTableOpen = YES; self.isTableOpen = YES;
...@@ -116,8 +116,8 @@ ...@@ -116,8 +116,8 @@
- (void)hideTableView { - (void)hideTableView {
[self.coverView hide]; [self.coverView hide];
// self.leftSortAction(NO); [self setOtherUserInteraction:YES];
[self viewController].navigationItem.leftBarButtonItem.enabled = YES;
self.isTableOpen = NO; self.isTableOpen = NO;
WS(weakSelf) WS(weakSelf)
[UIView animateWithDuration:0.3 animations:^{ [UIView animateWithDuration:0.3 animations:^{
...@@ -125,6 +125,15 @@ ...@@ -125,6 +125,15 @@
}]; }];
} }
//设置界面上其它的按钮是否可以点击
- (void)setOtherUserInteraction:(BOOL)state {
[self viewController].navigationItem.leftBarButtonItem.enabled = state;
[self viewController].navigationItem.rightBarButtonItem.enabled = state;
[self viewController].view.userInteractionEnabled = state;
}
#pragma mark ==============table delegate============== #pragma mark ==============table delegate==============
...@@ -185,7 +194,9 @@ ...@@ -185,7 +194,9 @@
} }
- (void)setLeftBtnTitle:(NSString *)str { - (void)setLeftBtnTitle:(NSString *)str {
[self.leftBtn setTitle:[NSString stringWithFormat:@"%@ ",str] forState:UIControlStateNormal];//只是为了让标题位置正确
//只是为了让标题位置正确
[self.leftBtn setTitle:[NSString stringWithFormat:@"%@ ",str] forState:UIControlStateNormal];
if (str.length > 4) { if (str.length > 4) {
self.leftBtn.imageEdgeInsets = UIEdgeInsetsMake(0, 130, 0, 0); self.leftBtn.imageEdgeInsets = UIEdgeInsetsMake(0, 130, 0, 0);
self.leftBtn.titleEdgeInsets = UIEdgeInsetsMake(0, -10, 0, 0); self.leftBtn.titleEdgeInsets = UIEdgeInsetsMake(0, -10, 0, 0);
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
</button> </button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="k9d-7S-PR5"> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="k9d-7S-PR5">
<rect key="frame" x="173" y="26" width="66" height="44"/> <rect key="frame" x="173" y="26" width="66" height="44"/>
<fontDescription key="fontDescription" type="system" pointSize="26"/> <fontDescription key="fontDescription" type="system" pointSize="21"/>
<state key="normal" title="下架" backgroundImage="greenbtn_bg"> <state key="normal" title="下架" backgroundImage="greenbtn_bg">
<color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</state> </state>
...@@ -40,14 +40,14 @@ ...@@ -40,14 +40,14 @@
<constraints> <constraints>
<constraint firstAttribute="height" constant="44" id="aLI-tT-ELQ"/> <constraint firstAttribute="height" constant="44" id="aLI-tT-ELQ"/>
</constraints> </constraints>
<fontDescription key="fontDescription" type="system" pointSize="26"/> <fontDescription key="fontDescription" type="system" pointSize="21"/>
<state key="normal" title="删除" backgroundImage="blackbtn"> <state key="normal" title="删除" backgroundImage="blackbtn">
<color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</state> </state>
</button> </button>
<button opaque="NO" contentMode="scaleToFill" horizontalCompressionResistancePriority="749" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="5Md-Ga-YFh"> <button opaque="NO" contentMode="scaleToFill" horizontalCompressionResistancePriority="749" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="5Md-Ga-YFh">
<rect key="frame" x="247" y="26" width="65" height="44"/> <rect key="frame" x="247" y="26" width="65" height="44"/>
<fontDescription key="fontDescription" type="system" pointSize="26"/> <fontDescription key="fontDescription" type="system" pointSize="21"/>
<state key="normal" title="上架" backgroundImage="greenbtn_bg"> <state key="normal" title="上架" backgroundImage="greenbtn_bg">
<color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</state> </state>
......
...@@ -30,9 +30,14 @@ ...@@ -30,9 +30,14 @@
[super viewDidLoad]; [super viewDidLoad];
self.navigationItem.title = @"添加商品"; self.navigationItem.title = @"添加商品";
[self setUpCollectionView]; [self setUpCollectionView];
[self updateStatueBarAppearance];
// Do any additional setup after loading the view. // Do any additional setup after loading the view.
} }
- (UIStatusBarStyle)preferredStatusBarStyle {
return UIStatusBarStyleDefault;
}
//隐藏navigationbar //隐藏navigationbar
- (void)viewWillAppear:(BOOL)animated { - (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated]; [super viewWillAppear:animated];
......
...@@ -11,6 +11,7 @@ typedef void (^tapBlock)(void); ...@@ -11,6 +11,7 @@ typedef void (^tapBlock)(void);
@interface CoverShadowView : UIView @interface CoverShadowView : UIView
@property (nonatomic, copy) tapBlock tapAction; @property (nonatomic, copy) tapBlock tapAction;
- (instancetype)initWithSpaceToTop:(CGFloat)spaceToTop; - (instancetype)initWithSpaceToTop:(CGFloat)spaceToTop;
- (instancetype)initOnTopWithHeight:(CGFloat)height;
- (void)show; - (void)show;
- (void)hide; - (void)hide;
@end @end
...@@ -24,6 +24,17 @@ ...@@ -24,6 +24,17 @@
return self; return self;
} }
- (instancetype)initOnTopWithHeight:(CGFloat)height {
self = [super init];
if (self) {
self.backgroundColor = [UIColor colorWithWhite:0.000 alpha:0.172];
self.alpha = 0;
self.frame = CGRectMake(0, 0, ScreenSize.width, height);
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(doTap)];
[self addGestureRecognizer:tap];
}
return self;
}
- (void)doTap { - (void)doTap {
self.tapAction(); self.tapAction();
......
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
#pragma mark - iOS7 Status bar #pragma mark - iOS7 Status bar
- (UIStatusBarStyle)preferredStatusBarStyle { - (UIStatusBarStyle)preferredStatusBarStyle {
return UIStatusBarStyleLightContent; return UIStatusBarStyleDefault;
} }
- (BOOL)prefersStatusBarHidden { - (BOOL)prefersStatusBarHidden {
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
#pragma mark - Life Cycle #pragma mark - Life Cycle
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
self.view.backgroundColor = kBacroundColor; self.view.backgroundColor = kBacroundColor;
self.navigationController.navigationBar.barTintColor = [UIColor colorWithHexString:@"fafafa"]; self.navigationController.navigationBar.barTintColor = [UIColor colorWithHexString:@"fafafa"];
UIBarButtonItem *leftBtn = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"bac"] style:UIBarButtonItemStyleDone target:self action:@selector(popAction)]; UIBarButtonItem *leftBtn = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"bac"] style:UIBarButtonItemStyleDone target:self action:@selector(popAction)];
...@@ -28,6 +28,8 @@ ...@@ -28,6 +28,8 @@
// Do any additional setup after loading the view. // Do any additional setup after loading the view.
} }
- (void)didReceiveMemoryWarning { - (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning]; [super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated. // Dispose of any resources that can be recreated.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment