Commit ce7d5509 authored by Sandy's avatar Sandy

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

parent 097973b0
......@@ -20,6 +20,7 @@
@property (nonatomic, strong) NSArray *arrLeft;
@property (nonatomic, strong) NSArray *arrRight;
@property (nonatomic, assign) NSInteger selectedMark;
@property (nonatomic, strong) CoverShadowView *viewTopCover;
@property (nonatomic, assign) BOOL isTableOpen;
@end
@implementation CommodityManagementSortView
......@@ -103,8 +104,7 @@
#pragma mark ==============animate==============
- (void)showTableView {
[self.coverView show];
//self.leftSortAction(YES);
[self viewController].navigationItem.leftBarButtonItem.enabled = NO;
[self setOtherUserInteraction:NO];
WS(weakSelf)
self.isTableOpen = YES;
......@@ -116,8 +116,8 @@
- (void)hideTableView {
[self.coverView hide];
// self.leftSortAction(NO);
[self viewController].navigationItem.leftBarButtonItem.enabled = YES;
[self setOtherUserInteraction:YES];
self.isTableOpen = NO;
WS(weakSelf)
[UIView animateWithDuration:0.3 animations:^{
......@@ -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==============
......@@ -185,7 +194,9 @@
}
- (void)setLeftBtnTitle:(NSString *)str {
[self.leftBtn setTitle:[NSString stringWithFormat:@"%@ ",str] forState:UIControlStateNormal];//只是为了让标题位置正确
//只是为了让标题位置正确
[self.leftBtn setTitle:[NSString stringWithFormat:@"%@ ",str] forState:UIControlStateNormal];
if (str.length > 4) {
self.leftBtn.imageEdgeInsets = UIEdgeInsetsMake(0, 130, 0, 0);
self.leftBtn.titleEdgeInsets = UIEdgeInsetsMake(0, -10, 0, 0);
......
......@@ -30,7 +30,7 @@
</button>
<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"/>
<fontDescription key="fontDescription" type="system" pointSize="26"/>
<fontDescription key="fontDescription" type="system" pointSize="21"/>
<state key="normal" title="下架" backgroundImage="greenbtn_bg">
<color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</state>
......@@ -40,14 +40,14 @@
<constraints>
<constraint firstAttribute="height" constant="44" id="aLI-tT-ELQ"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="26"/>
<fontDescription key="fontDescription" type="system" pointSize="21"/>
<state key="normal" title="删除" backgroundImage="blackbtn">
<color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</state>
</button>
<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"/>
<fontDescription key="fontDescription" type="system" pointSize="26"/>
<fontDescription key="fontDescription" type="system" pointSize="21"/>
<state key="normal" title="上架" backgroundImage="greenbtn_bg">
<color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</state>
......
......@@ -30,9 +30,14 @@
[super viewDidLoad];
self.navigationItem.title = @"添加商品";
[self setUpCollectionView];
[self updateStatueBarAppearance];
// Do any additional setup after loading the view.
}
- (UIStatusBarStyle)preferredStatusBarStyle {
return UIStatusBarStyleDefault;
}
//隐藏navigationbar
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
......
......@@ -11,6 +11,7 @@ typedef void (^tapBlock)(void);
@interface CoverShadowView : UIView
@property (nonatomic, copy) tapBlock tapAction;
- (instancetype)initWithSpaceToTop:(CGFloat)spaceToTop;
- (instancetype)initOnTopWithHeight:(CGFloat)height;
- (void)show;
- (void)hide;
@end
......@@ -24,6 +24,17 @@
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 {
self.tapAction();
......
......@@ -69,7 +69,7 @@
#pragma mark - iOS7 Status bar
- (UIStatusBarStyle)preferredStatusBarStyle {
return UIStatusBarStyleLightContent;
return UIStatusBarStyleDefault;
}
- (BOOL)prefersStatusBarHidden {
......
......@@ -17,7 +17,7 @@
#pragma mark - Life Cycle
- (void)viewDidLoad {
[super viewDidLoad];
self.view.backgroundColor = kBacroundColor;
self.navigationController.navigationBar.barTintColor = [UIColor colorWithHexString:@"fafafa"];
UIBarButtonItem *leftBtn = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"bac"] style:UIBarButtonItemStyleDone target:self action:@selector(popAction)];
......@@ -28,6 +28,8 @@
// Do any additional setup after loading the view.
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// 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