Commit c8794a95 authored by 刘俊宏's avatar 刘俊宏

完善自定义提示弹窗

parent 9f341912
...@@ -11,6 +11,20 @@ import UIKit ...@@ -11,6 +11,20 @@ import UIKit
class GeliAlertView: UIView { class GeliAlertView: UIView {
var contentView:UIView! var contentView:UIView!
@IBOutlet weak var titileLbl: UILabel!
@IBOutlet weak var tishiLbl: UILabel!
@IBOutlet weak var leftBtn: UIButton!
@IBOutlet weak var rightBtn: UIButton!
@IBAction func leftAction(_ sender: UIButton) {
print("左←边按钮响应")
self.removeFromSuperview()
}
@IBAction func rightAction(_ sender: UIButton) {
print("右→边按钮响应")
}
//初始化时将xib中的view添加进来 //初始化时将xib中的view添加进来
override init(frame: CGRect) { override init(frame: CGRect) {
super.init(frame: frame) super.init(frame: frame)
......
...@@ -7,7 +7,14 @@ ...@@ -7,7 +7,14 @@
<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"/> <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="GeliAlertView" customModule="GeliBusinessPlatform" customModuleProvider="target">
<connections>
<outlet property="leftBtn" destination="Dyd-7e-8BO" id="zeE-Lz-ROb"/>
<outlet property="rightBtn" destination="PtZ-E6-HsS" id="Emz-2g-FU4"/>
<outlet property="tishiLbl" destination="iMI-qP-BVc" id="zAu-zu-3me"/>
<outlet property="titileLbl" destination="7p8-wL-wRa" id="Qvs-im-IUC"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="iN0-l3-epB"> <view contentMode="scaleToFill" id="iN0-l3-epB">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/> <rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
...@@ -71,6 +78,9 @@ ...@@ -71,6 +78,9 @@
</fragment> </fragment>
</attributedString> </attributedString>
</state> </state>
<connections>
<action selector="leftAction:" destination="-1" eventType="touchUpInside" id="AFp-VK-m6e"/>
</connections>
</button> </button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" hasAttributedTitle="YES" translatesAutoresizingMaskIntoConstraints="NO" id="PtZ-E6-HsS"> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" hasAttributedTitle="YES" translatesAutoresizingMaskIntoConstraints="NO" id="PtZ-E6-HsS">
<rect key="frame" x="138" y="109" width="137" height="49"/> <rect key="frame" x="138" y="109" width="137" height="49"/>
...@@ -83,10 +93,14 @@ ...@@ -83,10 +93,14 @@
</fragment> </fragment>
</attributedString> </attributedString>
</state> </state>
<connections>
<action selector="rightAction:" destination="-1" eventType="touchUpInside" id="rn6-OP-dml"/>
</connections>
</button> </button>
</subviews> </subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/> <color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints> <constraints>
<constraint firstItem="xhi-ml-JFj" firstAttribute="top" secondItem="iMI-qP-BVc" secondAttribute="bottom" constant="10" id="1aG-41-dKY"/>
<constraint firstAttribute="trailing" secondItem="PtZ-E6-HsS" secondAttribute="trailing" id="2hY-Ev-agW"/> <constraint firstAttribute="trailing" secondItem="PtZ-E6-HsS" secondAttribute="trailing" id="2hY-Ev-agW"/>
<constraint firstAttribute="bottom" secondItem="xhi-ml-JFj" secondAttribute="bottom" constant="49" id="2nP-SJ-3dR"/> <constraint firstAttribute="bottom" secondItem="xhi-ml-JFj" secondAttribute="bottom" constant="49" id="2nP-SJ-3dR"/>
<constraint firstItem="Dyd-7e-8BO" firstAttribute="leading" secondItem="4ac-ng-NSx" secondAttribute="leading" id="2qn-nX-ZXk"/> <constraint firstItem="Dyd-7e-8BO" firstAttribute="leading" secondItem="4ac-ng-NSx" secondAttribute="leading" id="2qn-nX-ZXk"/>
...@@ -94,11 +108,6 @@ ...@@ -94,11 +108,6 @@
<constraint firstItem="7p8-wL-wRa" firstAttribute="leading" secondItem="4ac-ng-NSx" secondAttribute="leading" constant="25" id="4KC-YT-6RC"/> <constraint firstItem="7p8-wL-wRa" firstAttribute="leading" secondItem="4ac-ng-NSx" secondAttribute="leading" constant="25" id="4KC-YT-6RC"/>
<constraint firstItem="PtZ-E6-HsS" firstAttribute="top" secondItem="xhi-ml-JFj" secondAttribute="bottom" id="694-pb-BId"/> <constraint firstItem="PtZ-E6-HsS" firstAttribute="top" secondItem="xhi-ml-JFj" secondAttribute="bottom" id="694-pb-BId"/>
<constraint firstItem="iMI-qP-BVc" firstAttribute="centerX" secondItem="4ac-ng-NSx" secondAttribute="centerX" id="9Yj-DW-13K"/> <constraint firstItem="iMI-qP-BVc" firstAttribute="centerX" secondItem="4ac-ng-NSx" secondAttribute="centerX" id="9Yj-DW-13K"/>
<constraint firstAttribute="height" constant="158" id="A4o-mk-Kus">
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="isAdaptateScreen" value="YES"/>
</userDefinedRuntimeAttributes>
</constraint>
<constraint firstAttribute="bottom" secondItem="96c-u2-CE4" secondAttribute="bottom" constant="1" id="B8H-mF-8hg"/> <constraint firstAttribute="bottom" secondItem="96c-u2-CE4" secondAttribute="bottom" constant="1" id="B8H-mF-8hg"/>
<constraint firstItem="PtZ-E6-HsS" firstAttribute="leading" secondItem="96c-u2-CE4" secondAttribute="trailing" id="Hv9-Cf-9yK"/> <constraint firstItem="PtZ-E6-HsS" firstAttribute="leading" secondItem="96c-u2-CE4" secondAttribute="trailing" id="Hv9-Cf-9yK"/>
<constraint firstItem="Dyd-7e-8BO" firstAttribute="top" secondItem="xhi-ml-JFj" secondAttribute="bottom" id="Nib-ju-5Ol"/> <constraint firstItem="Dyd-7e-8BO" firstAttribute="top" secondItem="xhi-ml-JFj" secondAttribute="bottom" id="Nib-ju-5Ol"/>
...@@ -134,7 +143,7 @@ ...@@ -134,7 +143,7 @@
<constraint firstItem="4ac-ng-NSx" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="centerY" id="hTm-KA-r61"/> <constraint firstItem="4ac-ng-NSx" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="centerY" id="hTm-KA-r61"/>
<constraint firstItem="a7R-IF-Z00" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="t7C-DT-AP2"/> <constraint firstItem="a7R-IF-Z00" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="t7C-DT-AP2"/>
</constraints> </constraints>
<point key="canvasLocation" x="-320.28985507246381" y="246.42857142857142"/> <point key="canvasLocation" x="-155" y="111"/>
</view> </view>
</objects> </objects>
<resources> <resources>
...@@ -148,10 +157,10 @@ ...@@ -148,10 +157,10 @@
<color red="0.18000000715255737" green="0.18000000715255737" blue="0.18000000715255737" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color red="0.18000000715255737" green="0.18000000715255737" blue="0.18000000715255737" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor> </namedColor>
<namedColor name="灰色分界线"> <namedColor name="灰色分界线">
<color red="0.92900002002716064" green="0.92900002002716064" blue="0.92900002002716064" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color red="0.92941176470588238" green="0.92941176470588238" blue="0.92941176470588238" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor> </namedColor>
<namedColor name="灰色字体颜色"> <namedColor name="灰色字体颜色">
<color red="0.60000002384185791" green="0.60000002384185791" blue="0.60000002384185791" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor> </namedColor>
</resources> </resources>
</document> </document>
...@@ -943,7 +943,7 @@ ...@@ -943,7 +943,7 @@
<color red="0.92941176470588238" green="0.92941176470588238" blue="0.92941176470588238" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color red="0.92941176470588238" green="0.92941176470588238" blue="0.92941176470588238" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor> </namedColor>
<namedColor name="灰色字体颜色"> <namedColor name="灰色字体颜色">
<color red="0.60000002384185791" green="0.60000002384185791" blue="0.60000002384185791" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color red="0.59999999999999998" green="0.59999999999999998" blue="0.59999999999999998" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor> </namedColor>
<namedColor name="白色背景色"> <namedColor name="白色背景色">
<color red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
......
...@@ -17,8 +17,8 @@ class LoginViewController: BaseViewController { ...@@ -17,8 +17,8 @@ class LoginViewController: BaseViewController {
// @IBAction func forgetPasswordAction(_ sender: Any) { // @IBAction func forgetPasswordAction(_ sender: Any) {
//// let vc = DemoViewController() //// let vc = DemoViewController()
//// self.navigationController?.pushViewController(vc, animated: true) //// self.navigationController?.pushViewController(vc, animated: true)
// let alertView = GeliAlertView(frame: self.view.window!.bounds) // let alertView = GeliAlertView(frame: self.view.window!.bounds)
// self.view.window?.addSubview(alertView) // self.view.window?.addSubview(alertView)
// //
// } // }
// //
...@@ -80,7 +80,12 @@ class LoginViewController: BaseViewController { ...@@ -80,7 +80,12 @@ class LoginViewController: BaseViewController {
@IBAction func loginAction(_ sender: Any) { @IBAction func loginAction(_ sender: Any) {
print("loginAction") print("loginAction")
let vc = BluetoothConnectViewController() // let vc = BluetoothConnectViewController()
self.navigationController?.pushViewController(vc, animated: true) // self.navigationController?.pushViewController(vc, animated: true)
let alertView = GeliAlertView(frame: self.view.window!.bounds)
alertView.tishiLbl.text = "202121";
alertView.titileLbl.text = "是否确认取消订单?"
self.view.window?.addSubview(alertView)
} }
} }
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