连接wifi页面UI

This commit is contained in:
xuemh 2018-07-17 22:22:09 +08:00
parent bd9fe6d7aa
commit 2c3fcb1fe2
4 changed files with 227 additions and 21 deletions

View File

@ -70,7 +70,7 @@
</dict> </dict>
</array> </array>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>484</string> <string>485</string>
<key>ITSAppUsesNonExemptEncryption</key> <key>ITSAppUsesNonExemptEncryption</key>
<false/> <false/>
<key>LSApplicationCategoryType</key> <key>LSApplicationCategoryType</key>

View File

@ -8,7 +8,11 @@
#import "ConnectHotpotViewController.h" #import "ConnectHotpotViewController.h"
@interface ConnectHotpotViewController () @interface ConnectHotpotViewController ()<UITextFieldDelegate>
@property (weak, nonatomic) IBOutlet UIScrollView *scrollView;
@property (strong, nonatomic) IBOutletCollection(UIImageView) NSArray *dashView;
@property (weak, nonatomic) IBOutlet UITextField *pwdTf;
@property (weak, nonatomic) IBOutlet UIView *containerView;
@end @end
@ -17,21 +21,59 @@
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
self.title = @"热点连接"; self.title = @"热点连接";
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keybordframeChanged:) name:UIKeyboardDidChangeFrameNotification object:nil];
for (UIImageView *view in self.dashView) {
view.backgroundColor = [UIColor clearColor];
view.image = [self imageWithLineWithSize:view.frame.size];
}
} }
- (void)didReceiveMemoryWarning { - (UIImage *)imageWithLineWithSize:(CGSize)size{
[super didReceiveMemoryWarning]; CGFloat width = size.width;
// Dispose of any resources that can be recreated. UIGraphicsBeginImageContext(size);
CGContextSetLineCap(UIGraphicsGetCurrentContext(), kCGLineCapRound);
CGFloat lengths[] = {10,5};
CGContextRef line = UIGraphicsGetCurrentContext();
CGContextSetStrokeColorWithColor(line, [UIColor colorWithRed:133/255.0 green:133/255.0 blue:133/255.0 alpha:1.0].CGColor);
CGContextSetLineDash(line, 0, lengths, 1);
CGContextMoveToPoint(line, 0, 1);
CGContextAddLineToPoint(line, width-10, 1);
CGContextStrokePath(line);
return UIGraphicsGetImageFromCurrentImageContext();
} }
/* - (void)dealloc {
#pragma mark - Navigation [[NSNotificationCenter defaultCenter] removeObserver:self];
}
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { - (void)keybordframeChanged:(NSNotification *)no {
// Get the new view controller using [segue destinationViewController]. NSDictionary *userInfo = no.userInfo;
// Pass the selected object to the new view controller.
//
double duration = [userInfo[UIKeyboardAnimationDurationUserInfoKey] doubleValue];
// frame
CGRect keyboardF = [userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue];
keyboardF = [self.view convertRect:keyboardF fromView:self.view];
CGRect containerViewF = [self.view convertRect:self.containerView.frame fromView:self.scrollView];
CGFloat miniSpacing = 4;
CGFloat offset = CGRectGetMaxY(containerViewF) + miniSpacing - CGRectGetMinY(keyboardF);
if (offset <= 0) {
offset = 0;
}
[UIView animateWithDuration:duration animations:^{
self.scrollView.contentInset = UIEdgeInsetsMake(-offset, 0, 0, 0);
}];
}
#pragma mark - UITextFieldDelegate
- (BOOL)textFieldShouldReturn:(UITextField *)textField {
[textField resignFirstResponder];
return YES;
} }
*/
@end @end

View File

@ -6,19 +6,188 @@
<dependencies> <dependencies>
<deployment identifier="iOS"/> <deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
<capability name="Aspect ratio constraints" minToolsVersion="5.1"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies> </dependencies>
<objects> <objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="ConnectHotpotViewController"> <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="ConnectHotpotViewController">
<connections> <connections>
<outlet property="containerView" destination="1Km-pH-09L" id="XAO-g5-CDw"/>
<outlet property="pwdTf" destination="kiH-bp-24Q" id="PIU-eW-NJW"/>
<outlet property="scrollView" destination="rVr-h5-uWd" id="xVI-ZH-ZBs"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/> <outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
<outletCollection property="dashView" destination="g0t-sG-8Wn" id="LZL-DB-Zre"/>
<outletCollection property="dashView" destination="qEQ-pQ-mfJ" id="oNj-aK-CHc"/>
</connections> </connections>
</placeholder> </placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="i5M-Pr-FkT"> <view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="i5M-Pr-FkT">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/> <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <subviews>
<scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" alwaysBounceVertical="YES" showsHorizontalScrollIndicator="NO" showsVerticalScrollIndicator="NO" translatesAutoresizingMaskIntoConstraints="NO" id="rVr-h5-uWd">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="1Km-pH-09L">
<rect key="frame" x="0.0" y="0.0" width="375" height="186"/>
<subviews>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="YQa-dk-iMD">
<rect key="frame" x="16" y="8" width="30" height="30"/>
<color key="backgroundColor" red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="width" secondItem="YQa-dk-iMD" secondAttribute="height" multiplier="1:1" id="Q4v-qu-goC"/>
<constraint firstAttribute="width" constant="30" id="Z0H-DC-Jfc"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="热点连接" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="QfU-Iw-5Wj">
<rect key="frame" x="54" y="15" width="58" height="17"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="g0t-sG-8Wn" customClass="UIImageView">
<rect key="frame" x="54" y="40" width="305" height="1"/>
<color key="backgroundColor" red="0.77127617390000003" green="0.77127617390000003" blue="0.77127617390000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="Gkj-Pr-nXo"/>
</constraints>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="请将手机连接至wifi:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="kGw-DQ-YIO">
<rect key="frame" x="54" y="49" width="127" height="17"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="连接说明书,请" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dSQ-fr-q0c">
<rect key="frame" x="54" y="70" width="100" height="17"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="dDg-6q-BXw">
<rect key="frame" x="189" y="49" width="36" height="17"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="WQq-Kn-abo">
<rect key="frame" x="154" y="64" width="72" height="29"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<state key="normal" title="点击此处。"/>
</button>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="qEQ-pQ-mfJ" customClass="UIImageView">
<rect key="frame" x="54" y="101" width="305" height="1"/>
<color key="backgroundColor" red="0.77127617390000003" green="0.77127617390000003" blue="0.77127617390000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="1" id="hPn-jR-jsT"/>
</constraints>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="路由器名称" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="63z-z9-F6B">
<rect key="frame" x="54" y="116" width="72" height="17"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="路由器密码" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="svD-TG-gy8">
<rect key="frame" x="54" y="149" width="72" height="17"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="APB-5y-OkX">
<rect key="frame" x="134" y="110" width="225" height="30"/>
<nil key="textColor"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits" returnKeyType="done"/>
<connections>
<outlet property="delegate" destination="-1" id="egJ-r2-yXE"/>
</connections>
</textField>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="kiH-bp-24Q">
<rect key="frame" x="134" y="143" width="225" height="30"/>
<nil key="textColor"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits" returnKeyType="done"/>
<connections>
<outlet property="delegate" destination="-1" id="yMf-oO-0nW"/>
</connections>
</textField>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints>
<constraint firstItem="qEQ-pQ-mfJ" firstAttribute="top" secondItem="WQq-Kn-abo" secondAttribute="bottom" constant="8" id="4fb-6z-WQe"/>
<constraint firstItem="63z-z9-F6B" firstAttribute="top" secondItem="qEQ-pQ-mfJ" secondAttribute="bottom" constant="14" id="57S-tP-Zhv"/>
<constraint firstItem="dSQ-fr-q0c" firstAttribute="leading" secondItem="kGw-DQ-YIO" secondAttribute="leading" id="5D4-Vk-MRL"/>
<constraint firstItem="APB-5y-OkX" firstAttribute="centerY" secondItem="63z-z9-F6B" secondAttribute="centerY" id="5o9-8z-dnD"/>
<constraint firstItem="kGw-DQ-YIO" firstAttribute="leading" secondItem="QfU-Iw-5Wj" secondAttribute="leading" id="8Ym-vo-U81"/>
<constraint firstItem="kGw-DQ-YIO" firstAttribute="top" secondItem="g0t-sG-8Wn" secondAttribute="bottom" constant="8" id="A5z-xO-ypQ"/>
<constraint firstAttribute="trailing" secondItem="APB-5y-OkX" secondAttribute="trailing" constant="16" id="Cjf-I3-eC7"/>
<constraint firstItem="WQq-Kn-abo" firstAttribute="centerY" secondItem="dSQ-fr-q0c" secondAttribute="centerY" id="IoQ-o3-ziI"/>
<constraint firstAttribute="trailing" secondItem="g0t-sG-8Wn" secondAttribute="trailing" constant="16" id="IxD-TL-yIw"/>
<constraint firstItem="63z-z9-F6B" firstAttribute="leading" secondItem="qEQ-pQ-mfJ" secondAttribute="leading" id="KVJ-PL-rjZ"/>
<constraint firstItem="kiH-bp-24Q" firstAttribute="centerY" secondItem="svD-TG-gy8" secondAttribute="centerY" id="P4M-Td-w33"/>
<constraint firstItem="APB-5y-OkX" firstAttribute="leading" secondItem="63z-z9-F6B" secondAttribute="trailing" constant="8" id="T0L-Th-1SB"/>
<constraint firstAttribute="trailing" secondItem="qEQ-pQ-mfJ" secondAttribute="trailing" constant="16" id="TjV-nU-zhc"/>
<constraint firstItem="QfU-Iw-5Wj" firstAttribute="leading" secondItem="YQa-dk-iMD" secondAttribute="trailing" constant="8" id="VIx-06-fdp"/>
<constraint firstAttribute="bottom" secondItem="svD-TG-gy8" secondAttribute="bottom" constant="20" id="Vkp-LA-7KX"/>
<constraint firstItem="dDg-6q-BXw" firstAttribute="centerY" secondItem="kGw-DQ-YIO" secondAttribute="centerY" id="aSx-Fd-kY4"/>
<constraint firstItem="qEQ-pQ-mfJ" firstAttribute="leading" secondItem="dSQ-fr-q0c" secondAttribute="leading" id="cGV-Yt-MCE"/>
<constraint firstItem="WQq-Kn-abo" firstAttribute="leading" secondItem="dSQ-fr-q0c" secondAttribute="trailing" id="e1a-7p-7R1"/>
<constraint firstAttribute="trailing" secondItem="kiH-bp-24Q" secondAttribute="trailing" constant="16" id="ikC-8k-WQ9"/>
<constraint firstItem="dDg-6q-BXw" firstAttribute="leading" secondItem="kGw-DQ-YIO" secondAttribute="trailing" constant="8" id="jfy-Gz-dbp"/>
<constraint firstItem="dSQ-fr-q0c" firstAttribute="top" secondItem="kGw-DQ-YIO" secondAttribute="bottom" constant="4" id="kWG-mx-Kkc"/>
<constraint firstItem="g0t-sG-8Wn" firstAttribute="leading" secondItem="QfU-Iw-5Wj" secondAttribute="leading" id="mtM-T4-UDh"/>
<constraint firstItem="QfU-Iw-5Wj" firstAttribute="centerY" secondItem="YQa-dk-iMD" secondAttribute="centerY" id="ntz-Bt-5xY"/>
<constraint firstItem="g0t-sG-8Wn" firstAttribute="top" secondItem="QfU-Iw-5Wj" secondAttribute="bottom" constant="8" id="oou-Dr-PLm"/>
<constraint firstItem="svD-TG-gy8" firstAttribute="top" secondItem="63z-z9-F6B" secondAttribute="bottom" constant="16" id="qCO-SU-xw9"/>
<constraint firstItem="svD-TG-gy8" firstAttribute="leading" secondItem="63z-z9-F6B" secondAttribute="leading" id="rPY-Qz-GOx"/>
<constraint firstItem="YQa-dk-iMD" firstAttribute="top" secondItem="1Km-pH-09L" secondAttribute="top" constant="8" id="ttq-AW-hSb"/>
<constraint firstItem="YQa-dk-iMD" firstAttribute="leading" secondItem="1Km-pH-09L" secondAttribute="leading" constant="16" id="xms-lO-w5o"/>
<constraint firstItem="kiH-bp-24Q" firstAttribute="leading" secondItem="svD-TG-gy8" secondAttribute="trailing" constant="8" id="yW3-mV-4KC"/>
</constraints>
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="mTK-j3-V77">
<rect key="frame" x="36" y="204" width="303" height="30"/>
<color key="backgroundColor" red="0.082352941176470587" green="0.66274509803921566" blue="0.92156862745098034" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="8Ra-AW-7XB"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<state key="normal" title="设置连接"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
<integer key="value" value="4"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
</userDefinedRuntimeAttributes>
</button>
</subviews>
<constraints>
<constraint firstItem="1Km-pH-09L" firstAttribute="top" secondItem="rVr-h5-uWd" secondAttribute="top" id="3jw-tR-fsS"/>
<constraint firstItem="mTK-j3-V77" firstAttribute="centerX" secondItem="rVr-h5-uWd" secondAttribute="centerX" id="5wV-9b-X56"/>
<constraint firstAttribute="trailing" secondItem="mTK-j3-V77" secondAttribute="trailing" constant="36" id="H8Z-fV-gfn"/>
<constraint firstAttribute="trailing" secondItem="1Km-pH-09L" secondAttribute="trailing" id="O9f-Uo-1eB"/>
<constraint firstItem="mTK-j3-V77" firstAttribute="top" secondItem="1Km-pH-09L" secondAttribute="bottom" constant="18" id="V4L-Go-5vf"/>
<constraint firstItem="1Km-pH-09L" firstAttribute="leading" secondItem="rVr-h5-uWd" secondAttribute="leading" id="VEA-kw-md9"/>
<constraint firstItem="mTK-j3-V77" firstAttribute="leading" secondItem="rVr-h5-uWd" secondAttribute="leading" constant="36" id="XFL-cL-tgQ"/>
<constraint firstAttribute="bottom" secondItem="mTK-j3-V77" secondAttribute="bottom" constant="20" id="l5P-j3-zHM"/>
</constraints>
</scrollView>
</subviews>
<color key="backgroundColor" red="0.77127617390000003" green="0.77127617390000003" blue="0.77127617390000003" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstAttribute="trailing" secondItem="rVr-h5-uWd" secondAttribute="trailing" id="6YL-lw-Bp2"/>
<constraint firstItem="1Km-pH-09L" firstAttribute="width" secondItem="i5M-Pr-FkT" secondAttribute="width" id="7gz-wd-ya3"/>
<constraint firstAttribute="bottom" secondItem="rVr-h5-uWd" secondAttribute="bottom" id="UrT-BG-inV"/>
<constraint firstItem="rVr-h5-uWd" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="fKh-SC-M4t"/>
<constraint firstItem="rVr-h5-uWd" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="top" id="k3H-Mh-Bln"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="color" keyPath="borderColor">
<color key="value" red="0.77127617385786795" green="0.77127617385786795" blue="0.77127617385786795" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
<point key="canvasLocation" x="46.5" y="98.5"/>
</view> </view>
</objects> </objects>
</document> </document>

View File

@ -18,12 +18,7 @@ default_platform(:ios)
platform :ios do platform :ios do
desc "Push a new beta build to TestFlight" desc "Push a new beta build to TestFlight"
lane :beta do lane :beta do
build_app(scheme: "Ifish")
ensure_git_status_clean upload_to_testflight
increment_build_number
commit_version_bump
# push_to_git_remote
# build_app(scheme: "Ifish")
# upload_to_testflight
end end
end end