Skip to content

Commit

Permalink
dev:导航栏设计完成,增加了文字、图片、提醒、清单、群聊五个按钮
Browse files Browse the repository at this point in the history
  • Loading branch information
chenyufeng1991 committed Nov 12, 2015
1 parent f3882c7 commit 2f30a46
Show file tree
Hide file tree
Showing 21 changed files with 192 additions and 5 deletions.
21 changes: 21 additions & 0 deletions Oncenote/Assets.xcassets/main_alert.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "main_alert@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions Oncenote/Assets.xcassets/main_chat.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "main_chat@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions Oncenote/Assets.xcassets/main_list.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "main_list@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions Oncenote/Assets.xcassets/main_photo.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "main_photo@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions Oncenote/Assets.xcassets/main_text.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "main_text@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
"images" : [
{
"idiom" : "universal",
"filename" : "navi_refresh@2x副本.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "refresh@2x.png",
"scale" : "2x"
},
{
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
"images" : [
{
"idiom" : "universal",
"filename" : "navi_search@2x副本副本.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "search@2x.png",
"scale" : "2x"
},
{
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
"images" : [
{
"idiom" : "universal",
"filename" : "navi_setting@2x副本副本.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "setting@2x.png",
"scale" : "2x"
},
{
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
76 changes: 75 additions & 1 deletion Oncenote/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,75 @@
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="main_text" id="9EN-ZA-fwk">
<rect key="frame" x="19" y="79" width="50" height="50"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<animations/>
</imageView>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="main_photo" id="Gfu-AP-Ulk">
<rect key="frame" x="77" y="79" width="50" height="50"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<animations/>
</imageView>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="main_alert" id="dna-9O-1nv">
<rect key="frame" x="135" y="79" width="50" height="50"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<animations/>
</imageView>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="main_list" id="0qN-GZ-u2T">
<rect key="frame" x="193" y="79" width="50" height="50"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<animations/>
</imageView>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="main_chat" id="gVr-qn-03W">
<rect key="frame" x="251" y="79" width="50" height="50"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<animations/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="文字" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="oNE-Me-JB5">
<rect key="frame" x="29" y="130" width="30" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<animations/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="照片" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="wor-7Y-qd7">
<rect key="frame" x="87" y="130" width="30" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<animations/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="提醒" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="5L5-oI-oPX">
<rect key="frame" x="145" y="130" width="30" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<animations/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="清单" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="dUU-bL-Vds">
<rect key="frame" x="203" y="130" width="30" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<animations/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="群聊" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="wte-x8-lI9">
<rect key="frame" x="261" y="130" width="30" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<animations/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<animations/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<color key="backgroundColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
</view>
<navigationItem key="navigationItem" title="主界面" id="Bs1-GG-Xfh"/>
</viewController>
Expand Down Expand Up @@ -40,4 +107,11 @@
<point key="canvasLocation" x="206" y="321"/>
</scene>
</scenes>
<resources>
<image name="main_alert" width="58" height="56"/>
<image name="main_chat" width="57" height="56"/>
<image name="main_list" width="58" height="57"/>
<image name="main_photo" width="57" height="56"/>
<image name="main_text" width="57" height="56"/>
</resources>
</document>
10 changes: 9 additions & 1 deletion Oncenote/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,22 @@ - (void)viewDidLoad {

#pragma mark - 设置导航栏的按钮
- (void)setNavigationBarItemButton{

//设置导航栏的背景颜色;
[self.navigationController.navigationBar setBarTintColor:[UIColor colorWithRed:0.89 green:0.89 blue:0.89 alpha:1]];

//设置界面的背景颜色
self.view.backgroundColor = [UIColor colorWithRed:0.92 green:0.92 blue:0.92 alpha:1];


//设置左侧“设置”按钮;
UIButton *naviSettingButton = [UIButton buttonWithType:UIButtonTypeCustom];
[naviSettingButton setBackgroundImage:[UIImage imageNamed:@"navi_setting.png"] forState:UIControlStateNormal];
[naviSettingButton addTarget:self action:@selector(naviSettingButtonPressed:) forControlEvents:UIControlEventTouchUpInside];
naviSettingButton.frame = CGRectMake(0, 0, 30, 30);
UIBarButtonItem *naviSetting = [[UIBarButtonItem alloc] initWithCustomView:naviSettingButton];
self.navigationItem.leftBarButtonItem = naviSetting;

//设置右侧“刷新”,“查找”按钮;
UIButton *naviRefreshButton = [UIButton buttonWithType:UIButtonTypeCustom];
[naviRefreshButton setBackgroundImage:[UIImage imageNamed:@"navi_refresh.png"] forState:UIControlStateNormal];
Expand Down

0 comments on commit 2f30a46

Please sign in to comment.