Начал реализовывать пример добавления знака рубля в шрифт
This commit is contained in:
commit
32a6e7a372
|
|
@ -0,0 +1,27 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using MonoTouch.Foundation;
|
||||||
|
using MonoTouch.UIKit;
|
||||||
|
|
||||||
|
namespace Rouble
|
||||||
|
{
|
||||||
|
[Register ("AppDelegate")]
|
||||||
|
public partial class AppDelegate : UIApplicationDelegate
|
||||||
|
{
|
||||||
|
private UIWindow _window;
|
||||||
|
private MainController _mainController;
|
||||||
|
|
||||||
|
public override bool FinishedLaunching (UIApplication app, NSDictionary options)
|
||||||
|
{
|
||||||
|
_window = new UIWindow (UIScreen.MainScreen.Bounds);
|
||||||
|
_mainController = new MainController ();
|
||||||
|
|
||||||
|
_window.RootViewController = _mainController;
|
||||||
|
_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,26 @@
|
||||||
|
<?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>Rouble</string>
|
||||||
|
<key>CFBundleIdentifier</key>
|
||||||
|
<string>com.your-company.Rouble</string>
|
||||||
|
<key>UIDeviceFamily</key>
|
||||||
|
<array>
|
||||||
|
<integer>1</integer>
|
||||||
|
</array>
|
||||||
|
<key>UIAppFonts</key>
|
||||||
|
<array>
|
||||||
|
<string>Rouble.ttf</string>
|
||||||
|
</array>
|
||||||
|
<key>UISupportedInterfaceOrientations</key>
|
||||||
|
<array>
|
||||||
|
<string>UIInterfaceOrientationPortrait</string>
|
||||||
|
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||||
|
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||||
|
</array>
|
||||||
|
<key>MinimumOSVersion</key>
|
||||||
|
<string>6.0</string>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using MonoTouch.Foundation;
|
||||||
|
using MonoTouch.UIKit;
|
||||||
|
|
||||||
|
namespace Rouble
|
||||||
|
{
|
||||||
|
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,65 @@
|
||||||
|
using System;
|
||||||
|
|
||||||
|
using MonoTouch.UIKit;
|
||||||
|
using System.Drawing;
|
||||||
|
|
||||||
|
namespace Rouble
|
||||||
|
{
|
||||||
|
public class MainController : UIViewController
|
||||||
|
{
|
||||||
|
private const string Text = "Цена: 100 {0}";
|
||||||
|
|
||||||
|
private UILabel _label1;
|
||||||
|
private UILabel _label2;
|
||||||
|
private UILabel _label3;
|
||||||
|
|
||||||
|
|
||||||
|
public MainController ()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void ViewDidLoad ()
|
||||||
|
{
|
||||||
|
base.ViewDidLoad ();
|
||||||
|
|
||||||
|
View.BackgroundColor = UIColor.White;
|
||||||
|
|
||||||
|
_label1 = new UILabel ();
|
||||||
|
_label1.Text = Text;
|
||||||
|
View.AddSubview (_label1);
|
||||||
|
|
||||||
|
_label2 = new UILabel ();
|
||||||
|
_label2.Text = Text;
|
||||||
|
View.AddSubview (_label2);
|
||||||
|
|
||||||
|
_label3 = new UILabel ();
|
||||||
|
_label3.Text = Text;
|
||||||
|
View.AddSubview (_label3);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void ViewDidLayoutSubviews()
|
||||||
|
{
|
||||||
|
base.ViewWillLayoutSubviews ();
|
||||||
|
|
||||||
|
_label1.SizeToFit ();
|
||||||
|
_label1.Center = View.Center;
|
||||||
|
|
||||||
|
_label2.SizeToFit ();
|
||||||
|
_label2.Center = View.Center;
|
||||||
|
MoveY (_label2, -50f);
|
||||||
|
|
||||||
|
_label3.SizeToFit ();
|
||||||
|
_label3.Center = View.Center;
|
||||||
|
MoveY (_label3, 50f);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void MoveY(UIView view, float dy)
|
||||||
|
{
|
||||||
|
RectangleF frame = view.Frame;
|
||||||
|
frame.Y += dy;
|
||||||
|
view.Frame = frame;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,108 @@
|
||||||
|
<?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>
|
||||||
|
<ProductVersion>10.0.0</ProductVersion>
|
||||||
|
<SchemaVersion>2.0</SchemaVersion>
|
||||||
|
<ProjectGuid>{0F5F2F1C-52CD-4DF6-84F7-223D5CCEAAE9}</ProjectGuid>
|
||||||
|
<ProjectTypeGuids>{6BC8ED88-2882-458C-8E55-DFD12B67127B};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||||
|
<OutputType>Exe</OutputType>
|
||||||
|
<RootNamespace>Rouble</RootNamespace>
|
||||||
|
<IPhoneResourcePrefix>Resources</IPhoneResourcePrefix>
|
||||||
|
<AssemblyName>Rouble</AssemblyName>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|iPhoneSimulator' ">
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<Optimize>false</Optimize>
|
||||||
|
<OutputPath>bin\iPhoneSimulator\Debug</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;</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>
|
||||||
|
<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;</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>
|
||||||
|
<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>
|
||||||
|
<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>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
<CodesignKey>iPhone Distribution</CodesignKey>
|
||||||
|
<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
|
||||||
|
<ConsolePause>false</ConsolePause>
|
||||||
|
<CodesignProvision>Automatic:AppStore</CodesignProvision>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="System" />
|
||||||
|
<Reference Include="System.Xml" />
|
||||||
|
<Reference Include="System.Core" />
|
||||||
|
<Reference Include="monotouch" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Folder Include="Resources\" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="Info.plist" />
|
||||||
|
<None Include="Entitlements.plist" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="Main.cs" />
|
||||||
|
<Compile Include="AppDelegate.cs" />
|
||||||
|
<Compile Include="MainController.cs" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||||
|
<ItemGroup>
|
||||||
|
<BundleResource Include="..\Shared\Rouble.ttf">
|
||||||
|
<Link>Resources\Rouble.ttf</Link>
|
||||||
|
</BundleResource>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
|
|
@ -0,0 +1,32 @@
|
||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||||
|
# Visual Studio 2010
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Rouble", "IOs\Rouble.csproj", "{0F5F2F1C-52CD-4DF6-84F7-223D5CCEAAE9}"
|
||||||
|
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
|
||||||
|
{0F5F2F1C-52CD-4DF6-84F7-223D5CCEAAE9}.Ad-Hoc|iPhone.ActiveCfg = Ad-Hoc|iPhone
|
||||||
|
{0F5F2F1C-52CD-4DF6-84F7-223D5CCEAAE9}.Ad-Hoc|iPhone.Build.0 = Ad-Hoc|iPhone
|
||||||
|
{0F5F2F1C-52CD-4DF6-84F7-223D5CCEAAE9}.AppStore|iPhone.ActiveCfg = AppStore|iPhone
|
||||||
|
{0F5F2F1C-52CD-4DF6-84F7-223D5CCEAAE9}.AppStore|iPhone.Build.0 = AppStore|iPhone
|
||||||
|
{0F5F2F1C-52CD-4DF6-84F7-223D5CCEAAE9}.Debug|iPhone.ActiveCfg = Debug|iPhone
|
||||||
|
{0F5F2F1C-52CD-4DF6-84F7-223D5CCEAAE9}.Debug|iPhone.Build.0 = Debug|iPhone
|
||||||
|
{0F5F2F1C-52CD-4DF6-84F7-223D5CCEAAE9}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
|
||||||
|
{0F5F2F1C-52CD-4DF6-84F7-223D5CCEAAE9}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
|
||||||
|
{0F5F2F1C-52CD-4DF6-84F7-223D5CCEAAE9}.Release|iPhone.ActiveCfg = Release|iPhone
|
||||||
|
{0F5F2F1C-52CD-4DF6-84F7-223D5CCEAAE9}.Release|iPhone.Build.0 = Release|iPhone
|
||||||
|
{0F5F2F1C-52CD-4DF6-84F7-223D5CCEAAE9}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
|
||||||
|
{0F5F2F1C-52CD-4DF6-84F7-223D5CCEAAE9}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(MonoDevelopProperties) = preSolution
|
||||||
|
StartupItem = IOs\Rouble.csproj
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
||||||
Binary file not shown.
Loading…
Reference in New Issue