讓位數很多時變得美麗一點
This commit is contained in:
@@ -224,14 +224,14 @@
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="7" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="HLr-pN-Kn5">
|
||||
<rect key="frame" x="25" y="132" width="324" height="39"/>
|
||||
<rect key="frame" x="-427" y="132" width="776" height="39"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="32"/>
|
||||
<color key="textColor" systemColor="systemGrayColor" red="0.5568627451" green="0.5568627451" blue="0.57647058819999997" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="1+2×3" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="hBk-3O-ze9">
|
||||
<rect key="frame" x="25" y="73" width="324" height="51"/>
|
||||
<rect key="frame" x="-427" y="73" width="776" height="51"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="42"/>
|
||||
<nil key="textColor"/>
|
||||
|
||||
@@ -25,6 +25,13 @@ class ViewController: UIViewController {
|
||||
func updateView() {
|
||||
processLabel.text = calculator.process
|
||||
resultLabel.text = calculator.result
|
||||
if (calculator.process.count < 14) {
|
||||
processLabel.font = processLabel.font.withSize(42)
|
||||
} else if (calculator.process.count < 17) {
|
||||
processLabel.font = processLabel.font.withSize(34)
|
||||
} else {
|
||||
processLabel.font = processLabel.font.withSize(28)
|
||||
}
|
||||
}
|
||||
|
||||
override func viewDidLoad() {
|
||||
|
||||
Reference in New Issue
Block a user