forked from organicmaps/organicmaps
[ios] Fixed layout of action bar buttons.
This commit is contained in:
parent
6b9e4e62dd
commit
f131c79130
4 changed files with 43 additions and 26 deletions
|
@ -95,6 +95,8 @@ NSString * titleForButton(EButton type, BOOL isSelected)
|
|||
button.delegate = delegate;
|
||||
button.type = type;
|
||||
[view addSubview:button];
|
||||
button.width = view.width;
|
||||
button.autoresizingMask = UIViewAutoresizingNone;
|
||||
[button configButton:isSelected];
|
||||
}
|
||||
|
||||
|
@ -134,10 +136,4 @@ NSString * titleForButton(EButton type, BOOL isSelected)
|
|||
animationIV.animationRepeatCount = 1;
|
||||
}
|
||||
|
||||
- (void)layoutSubviews
|
||||
{
|
||||
self.frame = self.superview.bounds;
|
||||
[super layoutSubviews];
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="W07-Hz-J60" customClass="MWMButton">
|
||||
<rect key="frame" x="0.0" y="2" width="80" height="33"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="33" id="pcB-ET-28J"/>
|
||||
<constraint firstAttribute="height" constant="33" id="75j-xj-DA8"/>
|
||||
</constraints>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="coloringName" value="MWMBlack"/>
|
||||
|
@ -26,7 +26,7 @@
|
|||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" preferredMaxLayoutWidth="80" translatesAutoresizingMaskIntoConstraints="NO" id="rrI-0A-w3s">
|
||||
<rect key="frame" x="0.0" y="32" width="80" height="14"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="14" id="BBl-pC-RJq"/>
|
||||
<constraint firstAttribute="height" constant="14" id="aBc-T3-IKf"/>
|
||||
</constraints>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
||||
|
@ -39,13 +39,12 @@
|
|||
</subviews>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="trailing" secondItem="rrI-0A-w3s" secondAttribute="trailing" id="LPs-Yx-xz6"/>
|
||||
<constraint firstItem="rrI-0A-w3s" firstAttribute="top" secondItem="W07-Hz-J60" secondAttribute="bottom" constant="-3" id="SMD-s3-Tz5"/>
|
||||
<constraint firstItem="W07-Hz-J60" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="2" id="UJy-Ef-B7E"/>
|
||||
<constraint firstItem="rrI-0A-w3s" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="X6f-tU-o9a"/>
|
||||
<constraint firstAttribute="bottom" secondItem="rrI-0A-w3s" secondAttribute="bottom" constant="2" id="Zsi-G2-yc8"/>
|
||||
<constraint firstItem="W07-Hz-J60" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="rBR-of-5Ha"/>
|
||||
<constraint firstAttribute="trailing" secondItem="W07-Hz-J60" secondAttribute="trailing" id="teM-gm-CX7"/>
|
||||
<constraint firstItem="W07-Hz-J60" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="2" id="0ny-dj-oIy"/>
|
||||
<constraint firstItem="W07-Hz-J60" firstAttribute="width" secondItem="iN0-l3-epB" secondAttribute="width" id="Hs4-aJ-du5"/>
|
||||
<constraint firstItem="W07-Hz-J60" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="ZnD-Rd-u6r"/>
|
||||
<constraint firstItem="rrI-0A-w3s" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="de0-Vs-89Q"/>
|
||||
<constraint firstAttribute="bottom" secondItem="rrI-0A-w3s" secondAttribute="bottom" constant="2" id="elP-Ze-g3l"/>
|
||||
<constraint firstItem="rrI-0A-w3s" firstAttribute="width" secondItem="iN0-l3-epB" secondAttribute="width" id="wQ8-qm-ZSy"/>
|
||||
</constraints>
|
||||
<nil key="simulatedStatusBarMetrics"/>
|
||||
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
|
||||
|
|
|
@ -279,13 +279,10 @@ NSString * const kPlacePageActionBarNibName = @"PlacePageActionBar";
|
|||
- (void)layoutSubviews
|
||||
{
|
||||
[super layoutSubviews];
|
||||
self.separator.width = self.width;
|
||||
CGFloat const buttonWidth = self.width / self.buttons.count;
|
||||
uint8_t const buttonsCount = 4;
|
||||
CGFloat const buttonWidth = self.width / buttonsCount;
|
||||
for (UIView * button in self.buttons)
|
||||
{
|
||||
button.minX = buttonWidth * (button.tag - 1);
|
||||
button.width = buttonWidth;
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES">
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="10117" systemVersion="15E65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES">
|
||||
<dependencies>
|
||||
<deployment identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
|
||||
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
|
||||
|
@ -11,30 +12,54 @@
|
|||
<rect key="frame" x="0.0" y="0.0" width="360" height="48"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
|
||||
<subviews>
|
||||
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" image="separator_image" translatesAutoresizingMaskIntoConstraints="NO" id="WPU-f0-gXc">
|
||||
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="separator_image" translatesAutoresizingMaskIntoConstraints="NO" id="WPU-f0-gXc">
|
||||
<rect key="frame" x="0.0" y="0.0" width="360" height="1"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="1" id="fwa-pQ-MzY"/>
|
||||
</constraints>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="string" keyPath="coloring" value="MWMSeparator"/>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</imageView>
|
||||
<view tag="1" contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="ctK-eb-hsj" userLabel="First">
|
||||
<view tag="1" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="ctK-eb-hsj" userLabel="First">
|
||||
<rect key="frame" x="0.0" y="0.0" width="90" height="48"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
</view>
|
||||
<view tag="2" contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="j7d-3d-R7Z" userLabel="Second">
|
||||
<view tag="2" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="j7d-3d-R7Z" userLabel="Second">
|
||||
<rect key="frame" x="90" y="0.0" width="90" height="48"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
</view>
|
||||
<view tag="3" contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Xtb-qr-MYt" userLabel="Third">
|
||||
<view tag="3" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Xtb-qr-MYt" userLabel="Third">
|
||||
<rect key="frame" x="180" y="0.0" width="90" height="48"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
</view>
|
||||
<view tag="4" contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="A9L-Jr-3Qt" userLabel="Fourth">
|
||||
<view tag="4" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="A9L-Jr-3Qt" userLabel="Fourth">
|
||||
<rect key="frame" x="270" y="0.0" width="90" height="48"/>
|
||||
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
</view>
|
||||
</subviews>
|
||||
<color key="backgroundColor" red="0.96078431372549022" green="0.96078431372549022" blue="0.96078431372549022" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="trailing" secondItem="WPU-f0-gXc" secondAttribute="trailing" id="3ci-Pa-nsq"/>
|
||||
<constraint firstItem="j7d-3d-R7Z" firstAttribute="height" secondItem="ctK-eb-hsj" secondAttribute="height" id="58Q-JN-PJF"/>
|
||||
<constraint firstItem="A9L-Jr-3Qt" firstAttribute="height" secondItem="Xtb-qr-MYt" secondAttribute="height" id="80p-m5-neu"/>
|
||||
<constraint firstItem="ctK-eb-hsj" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="8ec-aS-2nF"/>
|
||||
<constraint firstItem="j7d-3d-R7Z" firstAttribute="width" secondItem="ctK-eb-hsj" secondAttribute="width" id="Cly-VY-PVg"/>
|
||||
<constraint firstItem="ctK-eb-hsj" firstAttribute="height" secondItem="iN0-l3-epB" secondAttribute="height" id="D4e-0R-7gX"/>
|
||||
<constraint firstItem="Xtb-qr-MYt" firstAttribute="height" secondItem="j7d-3d-R7Z" secondAttribute="height" id="EXS-qb-N3p"/>
|
||||
<constraint firstItem="A9L-Jr-3Qt" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="Hil-o4-mts"/>
|
||||
<constraint firstItem="Xtb-qr-MYt" firstAttribute="leading" secondItem="j7d-3d-R7Z" secondAttribute="trailing" id="KJq-hT-5Se"/>
|
||||
<constraint firstItem="Xtb-qr-MYt" firstAttribute="width" secondItem="j7d-3d-R7Z" secondAttribute="width" id="LRG-Cn-pIf"/>
|
||||
<constraint firstItem="ctK-eb-hsj" firstAttribute="width" secondItem="iN0-l3-epB" secondAttribute="width" multiplier="1:4" id="NiM-6S-wjX"/>
|
||||
<constraint firstItem="j7d-3d-R7Z" firstAttribute="leading" secondItem="ctK-eb-hsj" secondAttribute="trailing" id="V0e-Wq-sid"/>
|
||||
<constraint firstItem="WPU-f0-gXc" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="Zh3-QU-aoc"/>
|
||||
<constraint firstItem="Xtb-qr-MYt" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="dI1-hy-weQ"/>
|
||||
<constraint firstItem="WPU-f0-gXc" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="gdP-IW-kdh"/>
|
||||
<constraint firstItem="ctK-eb-hsj" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" id="kme-nG-ucC"/>
|
||||
<constraint firstAttribute="trailing" secondItem="A9L-Jr-3Qt" secondAttribute="trailing" id="ysu-Sa-yej"/>
|
||||
<constraint firstItem="A9L-Jr-3Qt" firstAttribute="width" secondItem="Xtb-qr-MYt" secondAttribute="width" id="zWt-T8-Sth"/>
|
||||
<constraint firstItem="j7d-3d-R7Z" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="zbW-L3-3vp"/>
|
||||
</constraints>
|
||||
<nil key="simulatedStatusBarMetrics"/>
|
||||
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
|
||||
<userDefinedRuntimeAttributes>
|
||||
|
|
Loading…
Add table
Reference in a new issue