mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-19 14:57:32 +09:00
Dactyloidae iOS initial commit
This commit is contained in:
parent
daa6179d22
commit
7154a0497e
2123 changed files with 197052 additions and 0 deletions
14
mobile/ios/ThirdParty/UIImageViewAligned/Example/ImageAlignment/AppDelegate.h
vendored
Normal file
14
mobile/ios/ThirdParty/UIImageViewAligned/Example/ImageAlignment/AppDelegate.h
vendored
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
//
|
||||
// AppDelegate.h
|
||||
// ImageAlignment
|
||||
//
|
||||
// Created by Andrei Stanescu on 7/29/13.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface AppDelegate : UIResponder <UIApplicationDelegate>
|
||||
|
||||
@property (strong, nonatomic) UIWindow *window;
|
||||
|
||||
@end
|
||||
45
mobile/ios/ThirdParty/UIImageViewAligned/Example/ImageAlignment/AppDelegate.m
vendored
Normal file
45
mobile/ios/ThirdParty/UIImageViewAligned/Example/ImageAlignment/AppDelegate.m
vendored
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
//
|
||||
// AppDelegate.m
|
||||
// ImageAlignment
|
||||
//
|
||||
// Created by Andrei Stanescu on 7/29/13.
|
||||
//
|
||||
|
||||
#import "AppDelegate.h"
|
||||
|
||||
@implementation AppDelegate
|
||||
|
||||
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
|
||||
{
|
||||
// Override point for customization after application launch.
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (void)applicationWillResignActive:(UIApplication *)application
|
||||
{
|
||||
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
|
||||
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
|
||||
}
|
||||
|
||||
- (void)applicationDidEnterBackground:(UIApplication *)application
|
||||
{
|
||||
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
|
||||
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
|
||||
}
|
||||
|
||||
- (void)applicationWillEnterForeground:(UIApplication *)application
|
||||
{
|
||||
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
|
||||
}
|
||||
|
||||
- (void)applicationDidBecomeActive:(UIApplication *)application
|
||||
{
|
||||
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
|
||||
}
|
||||
|
||||
- (void)applicationWillTerminate:(UIApplication *)application
|
||||
{
|
||||
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
|
||||
}
|
||||
|
||||
@end
|
||||
151
mobile/ios/ThirdParty/UIImageViewAligned/Example/ImageAlignment/Base.lproj/Main.storyboard
vendored
Normal file
151
mobile/ios/ThirdParty/UIImageViewAligned/Example/ImageAlignment/Base.lproj/Main.storyboard
vendored
Normal file
|
|
@ -0,0 +1,151 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="4471.1" systemVersion="12E55" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" initialViewController="vXZ-lx-hvc">
|
||||
<dependencies>
|
||||
<deployment defaultVersion="1536" identifier="iOS"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3697.3"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--View Controller-->
|
||||
<scene sceneID="ufC-wZ-h7g">
|
||||
<objects>
|
||||
<viewController id="vXZ-lx-hvc" customClass="ViewController" sceneMemberID="viewController">
|
||||
<view key="view" contentMode="scaleToFill" id="kh9-bI-dsS">
|
||||
<rect key="frame" x="0.0" y="0.0" width="320" height="480"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<subviews>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="melinda_landscape.jpg" id="Ts8-wG-AtN" customClass="UIImageViewAligned">
|
||||
<rect key="frame" x="35" y="0.0" width="250" height="233"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
<userDefinedRuntimeAttributes>
|
||||
<userDefinedRuntimeAttribute type="boolean" keyPath="alignTop" value="YES"/>
|
||||
<userDefinedRuntimeAttribute type="boolean" keyPath="alignLeft" value="YES"/>
|
||||
</userDefinedRuntimeAttributes>
|
||||
</imageView>
|
||||
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" id="Er1-8a-CIJ">
|
||||
<rect key="frame" x="265" y="248" width="51" height="31"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/>
|
||||
<connections>
|
||||
<action selector="onSwitchLandscape:" destination="vXZ-lx-hvc" eventType="valueChanged" id="NAP-T1-qKv"/>
|
||||
</connections>
|
||||
</switch>
|
||||
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" id="DcO-CL-d8v">
|
||||
<rect key="frame" x="135" y="347" width="51" height="31"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/>
|
||||
<connections>
|
||||
<action selector="onSwitchAlignTop:" destination="vXZ-lx-hvc" eventType="valueChanged" id="Hxp-Dk-wpK"/>
|
||||
</connections>
|
||||
</switch>
|
||||
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" id="Iz6-oo-AMY">
|
||||
<rect key="frame" x="169" y="386" width="51" height="31"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/>
|
||||
<connections>
|
||||
<action selector="onSwitchAlignRight:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="7EE-bm-eXc"/>
|
||||
</connections>
|
||||
</switch>
|
||||
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" id="pCW-Bd-6D9">
|
||||
<rect key="frame" x="103" y="386" width="51" height="31"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/>
|
||||
<connections>
|
||||
<action selector="onSwitchAlignLeft:" destination="vXZ-lx-hvc" eventType="valueChanged" id="SgO-rq-pTr"/>
|
||||
</connections>
|
||||
</switch>
|
||||
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" id="P4G-5O-K3g">
|
||||
<rect key="frame" x="135" y="425" width="51" height="31"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/>
|
||||
<connections>
|
||||
<action selector="onSwitchAlignBottom:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="506-Cs-pYl"/>
|
||||
</connections>
|
||||
</switch>
|
||||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Landscape/portrait image" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="d7x-Pi-0pa">
|
||||
<rect key="frame" x="40" y="253" width="217" height="21"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Top" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="CZH-lI-UmD">
|
||||
<rect key="frame" x="145" y="319" width="28" height="20"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Bottom" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="PLI-dF-Xlg">
|
||||
<rect key="frame" x="131" y="459" width="57" height="21"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="i5i-F5-s69">
|
||||
<rect key="frame" x="226" y="391" width="42" height="21"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Left" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="Y8C-zZ-RT7">
|
||||
<rect key="frame" x="53" y="391" width="42" height="21"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="ysz-7Z-kAf">
|
||||
<rect key="frame" x="47" y="282" width="253" height="29"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
|
||||
<fontDescription key="fontDescription" type="boldSystem" pointSize="11"/>
|
||||
<state key="normal" title="Content Mode">
|
||||
<color key="titleColor" red="0.19607843459999999" green="0.30980393290000002" blue="0.52156865600000002" alpha="1" colorSpace="calibratedRGB"/>
|
||||
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</state>
|
||||
<state key="highlighted">
|
||||
<color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="onButtonContentMode:" destination="vXZ-lx-hvc" eventType="touchUpInside" id="OPy-As-QyU"/>
|
||||
</connections>
|
||||
</button>
|
||||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="1." lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="rjo-y8-6Jj">
|
||||
<rect key="frame" x="6" y="249" width="21" height="30"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="25"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="2." lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="gyl-nA-RRy">
|
||||
<rect key="frame" x="6" y="282" width="21" height="30"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="25"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="3." lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="SIZ-0S-xHl">
|
||||
<rect key="frame" x="6" y="387" width="21" height="30"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="25"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
|
||||
</view>
|
||||
<simulatedScreenMetrics key="simulatedDestinationMetrics"/>
|
||||
<connections>
|
||||
<outlet property="alignedImageView" destination="Ts8-wG-AtN" id="H7O-Mg-9H5"/>
|
||||
<outlet property="btnContentMode" destination="ysz-7Z-kAf" id="foy-3f-t0b"/>
|
||||
<outlet property="swAlignBottom" destination="P4G-5O-K3g" id="Ntf-On-8IF"/>
|
||||
<outlet property="swAlignLeft" destination="pCW-Bd-6D9" id="CS2-6k-yMy"/>
|
||||
<outlet property="swAlignRight" destination="Iz6-oo-AMY" id="DN6-2V-dzV"/>
|
||||
<outlet property="swAlignTop" destination="DcO-CL-d8v" id="cqK-0b-ri4"/>
|
||||
<outlet property="swLandscape" destination="Er1-8a-CIJ" id="ieI-i5-VWW"/>
|
||||
</connections>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="x5A-6p-PRh" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="395" y="125"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
<resources>
|
||||
<image name="melinda_landscape.jpg" width="960" height="720"/>
|
||||
</resources>
|
||||
<simulatedMetricsContainer key="defaultSimulatedMetrics">
|
||||
<simulatedStatusBarMetrics key="statusBar"/>
|
||||
<simulatedOrientationMetrics key="orientation"/>
|
||||
<simulatedScreenMetrics key="destination" type="retina4"/>
|
||||
</simulatedMetricsContainer>
|
||||
</document>
|
||||
40
mobile/ios/ThirdParty/UIImageViewAligned/Example/ImageAlignment/ImageAlignment-Info.plist
vendored
Normal file
40
mobile/ios/ThirdParty/UIImageViewAligned/Example/ImageAlignment/ImageAlignment-Info.plist
vendored
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>${PRODUCT_NAME}</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.reydanro.${PRODUCT_NAME:rfc1034identifier}</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>${PRODUCT_NAME}</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>UIMainStoryboardFile</key>
|
||||
<string>Main</string>
|
||||
<key>UIRequiredDeviceCapabilities</key>
|
||||
<array>
|
||||
<string>armv7</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
16
mobile/ios/ThirdParty/UIImageViewAligned/Example/ImageAlignment/ImageAlignment-Prefix.pch
vendored
Normal file
16
mobile/ios/ThirdParty/UIImageViewAligned/Example/ImageAlignment/ImageAlignment-Prefix.pch
vendored
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
//
|
||||
// Prefix header
|
||||
//
|
||||
// The contents of this file are implicitly included at the beginning of every source file.
|
||||
//
|
||||
|
||||
#import <Availability.h>
|
||||
|
||||
#ifndef __IPHONE_5_0
|
||||
#warning "This project uses features only available in iOS SDK 5.0 and later."
|
||||
#endif
|
||||
|
||||
#ifdef __OBJC__
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
#endif
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "29x29",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "iphone",
|
||||
"size" : "60x60",
|
||||
"scale" : "2x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
"images" : [
|
||||
{
|
||||
"orientation" : "portrait",
|
||||
"idiom" : "iphone",
|
||||
"extent" : "full-screen",
|
||||
"minimum-system-version" : "7.0",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"orientation" : "portrait",
|
||||
"idiom" : "iphone",
|
||||
"subtype" : "retina4",
|
||||
"extent" : "full-screen",
|
||||
"minimum-system-version" : "7.0",
|
||||
"scale" : "2x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
30
mobile/ios/ThirdParty/UIImageViewAligned/Example/ImageAlignment/ViewController.h
vendored
Normal file
30
mobile/ios/ThirdParty/UIImageViewAligned/Example/ImageAlignment/ViewController.h
vendored
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
//
|
||||
// ViewController.h
|
||||
// ImageAlignment
|
||||
//
|
||||
// Created by Andrei Stanescu on 7/29/13.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "UIImageViewAligned.h"
|
||||
|
||||
@interface ViewController : UIViewController {
|
||||
NSArray* _contentModeStrings;
|
||||
}
|
||||
@property (weak, nonatomic) IBOutlet UIImageViewAligned *alignedImageView;
|
||||
|
||||
@property (weak, nonatomic) IBOutlet UISwitch *swLandscape;
|
||||
@property (weak, nonatomic) IBOutlet UIButton *btnContentMode;
|
||||
@property (weak, nonatomic) IBOutlet UISwitch *swAlignTop;
|
||||
@property (weak, nonatomic) IBOutlet UISwitch *swAlignRight;
|
||||
@property (weak, nonatomic) IBOutlet UISwitch *swAlignBottom;
|
||||
@property (weak, nonatomic) IBOutlet UISwitch *swAlignLeft;
|
||||
|
||||
- (IBAction)onSwitchLandscape:(id)sender;
|
||||
- (IBAction)onButtonContentMode:(id)sender;
|
||||
- (IBAction)onSwitchAlignTop:(id)sender;
|
||||
- (IBAction)onSwitchAlignRight:(id)sender;
|
||||
- (IBAction)onSwitchAlignBottom:(id)sender;
|
||||
- (IBAction)onSwitchAlignLeft:(id)sender;
|
||||
|
||||
@end
|
||||
79
mobile/ios/ThirdParty/UIImageViewAligned/Example/ImageAlignment/ViewController.m
vendored
Normal file
79
mobile/ios/ThirdParty/UIImageViewAligned/Example/ImageAlignment/ViewController.m
vendored
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
//
|
||||
// ViewController.m
|
||||
// ImageAlignment
|
||||
//
|
||||
// Created by Andrei Stanescu on 7/29/13.
|
||||
//
|
||||
|
||||
#import "ViewController.h"
|
||||
|
||||
@interface ViewController ()
|
||||
|
||||
@end
|
||||
|
||||
@implementation ViewController
|
||||
|
||||
- (void)viewDidLoad
|
||||
{
|
||||
[super viewDidLoad];
|
||||
|
||||
_contentModeStrings = [NSArray arrayWithObjects:
|
||||
@"UIViewContentModeScaleToFill",
|
||||
@"UIViewContentModeScaleAspectFit", // contents scaled to fit with fixed aspect. remainder is transparent
|
||||
@"UIViewContentModeScaleAspectFill", // contents scaled to fill with fixed aspect. some portion of content may be clipped.
|
||||
@"UIViewContentModeRedraw", // redraw on bounds change (calls -setNeedsDisplay)
|
||||
@"UIViewContentModeCenter", // contents remain same size. positioned adjusted.
|
||||
@"UIViewContentModeTop",
|
||||
@"UIViewContentModeBottom",
|
||||
@"UIViewContentModeLeft",
|
||||
@"UIViewContentModeRight",
|
||||
@"UIViewContentModeTopLeft",
|
||||
@"UIViewContentModeTopRight",
|
||||
@"UIViewContentModeBottomLeft",
|
||||
@"UIViewContentModeBottomRight", nil];
|
||||
|
||||
_swLandscape.on = (_alignedImageView.image != nil) && _alignedImageView.image.size.width >= _alignedImageView.image.size.height;
|
||||
|
||||
_swAlignLeft.on = _alignedImageView.alignLeft;
|
||||
_swAlignRight.on = _alignedImageView.alignRight;
|
||||
_swAlignTop.on = _alignedImageView.alignTop;
|
||||
_swAlignBottom.on = _alignedImageView.alignBottom;
|
||||
|
||||
[self refreshContentModeButtonTitle];
|
||||
}
|
||||
|
||||
- (IBAction)onSwitchLandscape:(id)sender {
|
||||
if (_swLandscape.on)
|
||||
_alignedImageView.image = [UIImage imageNamed:@"melinda_landscape.jpg"];
|
||||
else
|
||||
_alignedImageView.image = [UIImage imageNamed:@"melinda_portrait.jpg"];
|
||||
}
|
||||
|
||||
- (IBAction)onButtonContentMode:(id)sender
|
||||
{
|
||||
_alignedImageView.contentMode = (_alignedImageView.contentMode + 1) % (UIViewContentModeBottomRight+1); // bit of hardcoding..but only for the purposes of this example
|
||||
[self refreshContentModeButtonTitle];
|
||||
}
|
||||
|
||||
- (IBAction)onSwitchAlignTop:(id)sender {
|
||||
_alignedImageView.alignTop
|
||||
= _swAlignTop.on;
|
||||
}
|
||||
|
||||
- (IBAction)onSwitchAlignRight:(id)sender {
|
||||
_alignedImageView.alignRight = _swAlignRight.on;
|
||||
}
|
||||
|
||||
- (IBAction)onSwitchAlignBottom:(id)sender {
|
||||
_alignedImageView.alignBottom = _swAlignBottom.on;
|
||||
}
|
||||
|
||||
- (IBAction)onSwitchAlignLeft:(id)sender {
|
||||
_alignedImageView.alignLeft = _swAlignLeft.on;
|
||||
}
|
||||
|
||||
- (void)refreshContentModeButtonTitle
|
||||
{
|
||||
[_btnContentMode setTitle:_contentModeStrings[_alignedImageView.contentMode] forState:UIControlStateNormal];
|
||||
}
|
||||
@end
|
||||
2
mobile/ios/ThirdParty/UIImageViewAligned/Example/ImageAlignment/en.lproj/InfoPlist.strings
vendored
Normal file
2
mobile/ios/ThirdParty/UIImageViewAligned/Example/ImageAlignment/en.lproj/InfoPlist.strings
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
/* Localized versions of Info.plist keys */
|
||||
|
||||
17
mobile/ios/ThirdParty/UIImageViewAligned/Example/ImageAlignment/main.m
vendored
Normal file
17
mobile/ios/ThirdParty/UIImageViewAligned/Example/ImageAlignment/main.m
vendored
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
//
|
||||
// main.m
|
||||
// ImageAlignment
|
||||
//
|
||||
// Created by Andrei Stanescu on 7/29/13.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#import "AppDelegate.h"
|
||||
|
||||
int main(int argc, char * argv[])
|
||||
{
|
||||
@autoreleasepool {
|
||||
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
|
||||
}
|
||||
}
|
||||
BIN
mobile/ios/ThirdParty/UIImageViewAligned/Example/ImageAlignment/melinda_landscape.jpg
vendored
Normal file
BIN
mobile/ios/ThirdParty/UIImageViewAligned/Example/ImageAlignment/melinda_landscape.jpg
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 81 KiB |
BIN
mobile/ios/ThirdParty/UIImageViewAligned/Example/ImageAlignment/melinda_portrait.jpg
vendored
Normal file
BIN
mobile/ios/ThirdParty/UIImageViewAligned/Example/ImageAlignment/melinda_portrait.jpg
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 41 KiB |
Loading…
Add table
Add a link
Reference in a new issue