Adding sample for Intro to Storyboard doc

This commit is contained in:
Amy Burns 2014-04-25 15:43:14 -04:00
Родитель fd315b2b03
Коммит 7052cc5338
16 изменённых файлов: 425 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,32 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ManualStoryboard", "ManualStoryboard\ManualStoryboard.csproj", "{E3834E0F-1908-4AEF-88F7-8FB8CE3FEDF4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|iPhoneSimulator = Debug|iPhoneSimulator
Release|iPhoneSimulator = Release|iPhoneSimulator
Debug|iPhone = Debug|iPhone
Release|iPhone = Release|iPhone
Ad-Hoc|iPhone = Ad-Hoc|iPhone
AppStore|iPhone = AppStore|iPhone
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E3834E0F-1908-4AEF-88F7-8FB8CE3FEDF4}.Ad-Hoc|iPhone.ActiveCfg = Ad-Hoc|iPhone
{E3834E0F-1908-4AEF-88F7-8FB8CE3FEDF4}.Ad-Hoc|iPhone.Build.0 = Ad-Hoc|iPhone
{E3834E0F-1908-4AEF-88F7-8FB8CE3FEDF4}.AppStore|iPhone.ActiveCfg = AppStore|iPhone
{E3834E0F-1908-4AEF-88F7-8FB8CE3FEDF4}.AppStore|iPhone.Build.0 = AppStore|iPhone
{E3834E0F-1908-4AEF-88F7-8FB8CE3FEDF4}.Debug|iPhone.ActiveCfg = Debug|iPhone
{E3834E0F-1908-4AEF-88F7-8FB8CE3FEDF4}.Debug|iPhone.Build.0 = Debug|iPhone
{E3834E0F-1908-4AEF-88F7-8FB8CE3FEDF4}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
{E3834E0F-1908-4AEF-88F7-8FB8CE3FEDF4}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
{E3834E0F-1908-4AEF-88F7-8FB8CE3FEDF4}.Release|iPhone.ActiveCfg = Release|iPhone
{E3834E0F-1908-4AEF-88F7-8FB8CE3FEDF4}.Release|iPhone.Build.0 = Release|iPhone
{E3834E0F-1908-4AEF-88F7-8FB8CE3FEDF4}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
{E3834E0F-1908-4AEF-88F7-8FB8CE3FEDF4}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
StartupItem = ManualStoryboard\ManualStoryboard.csproj
EndGlobalSection
EndGlobal

Просмотреть файл

@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using System.Linq;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
namespace ManualStoryboard
{
// The UIApplicationDelegate for the application. This class is responsible for launching the
// User Interface of the application, as well as listening (and optionally responding) to
// application events from iOS.
[Register ("AppDelegate")]
public partial class AppDelegate : UIApplicationDelegate
{
// class-level declarations
UIWindow window;
public static UIStoryboard Storyboard = UIStoryboard.FromName ("MainStoryboard", null);
public static UIViewController initialViewController;
public override bool FinishedLaunching (UIApplication app, NSDictionary options)
{
window = new UIWindow (UIScreen.MainScreen.Bounds);
initialViewController = Storyboard.InstantiateInitialViewController () as UIViewController;
window.RootViewController = initialViewController;
window.MakeKeyAndVisible ();
return true;
}
}
}

Просмотреть файл

@ -0,0 +1,6 @@
<?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>
</dict>
</plist>

Просмотреть файл

@ -0,0 +1,34 @@
<?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>CFBundleDisplayName</key>
<string>ManualStoryboard</string>
<key>CFBundleIdentifier</key>
<string>com.your-company.ManualStoryboard</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>MinimumOSVersion</key>
<string>7.0</string>
<key>UIDeviceFamily</key>
<array>
<integer>1</integer>
</array>
<key>UIMainStoryboardFile</key>
<string>MainStoryboard</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>

Просмотреть файл

@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
namespace ManualStoryboard
{
public class Application
{
// This is the main entry point of the application.
static void Main (string[] args)
{
// if you want to use a different Application Delegate class from "AppDelegate"
// you can specify it here.
UIApplication.Main (args, null, "AppDelegate");
}
}
}

Просмотреть файл

@ -0,0 +1,73 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="4443" systemVersion="13A451" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="1">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3733"/>
</dependencies>
<scenes>
<scene sceneID="0">
<objects>
<navigationController definesPresentationContext="YES" id="1" sceneMemberID="viewController">
<navigationBar key="navigationBar" contentMode="scaleToFill" id="4">
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
</navigationBar>
<connections>
<segue destination="3" kind="relationship" relationship="rootViewController" id="23"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="5" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-511" y="-303"/>
</scene>
<scene sceneID="6">
<objects>
<viewController id="3" sceneMemberID="viewController" customClass="MainViewController" storyboardIdentifier="MainViewController" restorationIdentifier="MainViewController" title="Main">
<view key="view" contentMode="scaleToFill" id="8">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="19" fixedFrame="YES">
<rect key="frame" x="57" y="153" width="201" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<state key="normal" title="GoToPink">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
</button>
</subviews>
</view>
<navigationItem key="navigationItem" title="Main" id="7"/>
<connections>
<outlet property="PinkButton" destination="19" id="name-outlet-19"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="9" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-52" y="-302"/>
</scene>
<scene sceneID="12">
<objects>
<viewController id="13" sceneMemberID="viewController" customClass="PinkViewController" storyboardIdentifier="PinkViewController" restorationIdentifier="PinkViewController" title="Pink View Controller">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="15"/>
<viewControllerLayoutGuide type="bottom" id="16"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="14">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" customColorSpace="calibratedWhite" colorSpace="calibratedRGB" red="1" green="0" blue="1" alpha="1"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="17" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="362" y="-301"/>
</scene>
</scenes>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination" type="retina4"/>
</simulatedMetricsContainer>
<resources>
<image name="Default-568h.png" width="640" height="1136"/>
</resources>
</document>

Просмотреть файл

@ -0,0 +1,35 @@
using System;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using System.CodeDom.Compiler;
namespace ManualStoryboard
{
public partial class MainViewController : UIViewController
{
UIViewController pinkViewController;
public MainViewController (IntPtr handle) : base (handle)
{
this.Initialize ();
}
public void Initialize(){
var myStoryboard = AppDelegate.Storyboard;
//Instatiating View Controller with Storyboard ID 'PinkViewController'
pinkViewController = myStoryboard.InstantiateViewController ("PinkViewController") as PinkViewController;
}
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
//When we push the button, we will push the pinkViewController onto our current Navigation Stack
PinkButton.TouchUpInside += (o, e) => {
this.NavigationController.PushViewController (pinkViewController, true);
};
}
}
}

29
ManualStoryboard/ManualStoryboard/MainViewController.designer.cs сгенерированный Normal file
Просмотреть файл

@ -0,0 +1,29 @@
// WARNING
//
// This file has been generated automatically by Xamarin Studio from the outlets and
// actions declared in your storyboard file.
// Manual changes to this file will not be maintained.
//
using System;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using System.CodeDom.Compiler;
namespace ManualStoryboard
{
[Register ("MainViewController")]
partial class MainViewController
{
[Outlet]
[GeneratedCode ("iOS Designer", "1.0")]
UIButton PinkButton { get; set; }
void ReleaseDesignerOutlets ()
{
if (PinkButton != null) {
PinkButton.Dispose ();
PinkButton = null;
}
}
}
}

Просмотреть файл

@ -0,0 +1,115 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">iPhoneSimulator</Platform>
<ProjectGuid>{E3834E0F-1908-4AEF-88F7-8FB8CE3FEDF4}</ProjectGuid>
<ProjectTypeGuids>{6BC8ED88-2882-458C-8E55-DFD12B67127B};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Exe</OutputType>
<RootNamespace>ManualStoryboard</RootNamespace>
<IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>
<AssemblyName>ManualStoryboard</AssemblyName>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\iPhoneSimulator\Debug</OutputPath>
<DefineConstants>DEBUG;__MOBILE__;__IOS__;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<MtouchLink>None</MtouchLink>
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
<MtouchDebug>true</MtouchDebug>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' ">
<DebugType>full</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\iPhoneSimulator\Release</OutputPath>
<DefineConstants>__MOBILE__;__IOS__;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<MtouchLink>None</MtouchLink>
<ConsolePause>false</ConsolePause>
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhone' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\iPhone\Debug</OutputPath>
<DefineConstants>DEBUG;__MOBILE__;__IOS__;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
<MtouchDebug>true</MtouchDebug>
<CodesignKey>iPhone Developer</CodesignKey>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|iPhone' ">
<DebugType>full</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\iPhone\Release</OutputPath>
<DefineConstants>__MOBILE__;__IOS__;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
<ConsolePause>false</ConsolePause>
<CodesignKey>iPhone Developer</CodesignKey>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Ad-Hoc|iPhone' ">
<DebugType>full</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\iPhone\Ad-Hoc</OutputPath>
<DefineConstants>__MOBILE__;__IOS__;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
<BuildIpa>true</BuildIpa>
<CodesignProvision>Automatic:AdHoc</CodesignProvision>
<CodesignKey>iPhone Distribution</CodesignKey>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'AppStore|iPhone' ">
<DebugType>full</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\iPhone\AppStore</OutputPath>
<DefineConstants>__MOBILE__;__IOS__;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
<CodesignProvision>Automatic:AppStore</CodesignProvision>
<CodesignKey>iPhone Distribution</CodesignKey>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="monotouch" />
</ItemGroup>
<ItemGroup>
<BundleResource Include="Resources\Default-568h%402x.png" />
</ItemGroup>
<ItemGroup>
<None Include="Info.plist" />
<None Include="Entitlements.plist" />
</ItemGroup>
<ItemGroup>
<Compile Include="Main.cs" />
<Compile Include="AppDelegate.cs" />
<Compile Include="MainViewController.cs" />
<Compile Include="MainViewController.designer.cs">
<DependentUpon>MainViewController.cs</DependentUpon>
</Compile>
<Compile Include="PinkViewController.cs" />
<Compile Include="PinkViewController.designer.cs">
<DependentUpon>PinkViewController.cs</DependentUpon>
</Compile>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
<InterfaceDefinition Include="MainStoryboard.storyboard" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,14 @@
using System;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using System.CodeDom.Compiler;
namespace ManualStoryboard
{
partial class PinkViewController : UIViewController
{
public PinkViewController (IntPtr handle) : base (handle)
{
}
}
}

21
ManualStoryboard/ManualStoryboard/PinkViewController.designer.cs сгенерированный Normal file
Просмотреть файл

@ -0,0 +1,21 @@
// WARNING
//
// This file has been generated automatically by Xamarin Studio from the outlets and
// actions declared in your storyboard file.
// Manual changes to this file will not be maintained.
//
using System;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using System.CodeDom.Compiler;
namespace ManualStoryboard
{
[Register ("PinkViewController")]
partial class PinkViewController
{
void ReleaseDesignerOutlets ()
{
}
}
}

Двоичные данные
ManualStoryboard/ManualStoryboard/Resources/Default-568h@2x.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 2.2 KiB

Просмотреть файл

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<SampleMetadata>
<ID>6870d304-f6bc-46db-940a-a82c3a7d205b</ID>
<IsFullApplication>false</IsFullApplication>
<Level>Beginning</Level>
<Gallery>false</Gallery>
</SampleMetadata>

Просмотреть файл

@ -0,0 +1,6 @@
Manual Storyboard
=================
How to instantiate Storyboards programatically. This is the finished application from the [Instantiate Storyboards Manually](http://docs.xamarin.com/guides/ios/user_interface/introduction_to_storyboards/#Instantiate_Storyboards_Manually) section of the Introduction to Storyboards document.

Двоичные данные
ManualStoryboard/Screenshots/mvc.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 28 KiB

Двоичные данные
ManualStoryboard/Screenshots/pvc.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 30 KiB