commit 32a6e7a37219b1eb0b83874c65321d2f25696c2a Author: Rustam Zaitov Date: Wed Feb 5 21:32:03 2014 +0400 Начал реализовывать пример добавления знака рубля в шрифт diff --git a/Rouble/IOs/AppDelegate.cs b/Rouble/IOs/AppDelegate.cs new file mode 100644 index 0000000..30a5ab3 --- /dev/null +++ b/Rouble/IOs/AppDelegate.cs @@ -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; + } + } +} + diff --git a/Rouble/IOs/Entitlements.plist b/Rouble/IOs/Entitlements.plist new file mode 100644 index 0000000..5ea1ec7 --- /dev/null +++ b/Rouble/IOs/Entitlements.plist @@ -0,0 +1,6 @@ + + + + + + diff --git a/Rouble/IOs/Info.plist b/Rouble/IOs/Info.plist new file mode 100644 index 0000000..f840480 --- /dev/null +++ b/Rouble/IOs/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDisplayName + Rouble + CFBundleIdentifier + com.your-company.Rouble + UIDeviceFamily + + 1 + + UIAppFonts + + Rouble.ttf + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + MinimumOSVersion + 6.0 + + diff --git a/Rouble/IOs/Main.cs b/Rouble/IOs/Main.cs new file mode 100644 index 0000000..822edfa --- /dev/null +++ b/Rouble/IOs/Main.cs @@ -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"); + } + } +} diff --git a/Rouble/IOs/MainController.cs b/Rouble/IOs/MainController.cs new file mode 100644 index 0000000..57135db --- /dev/null +++ b/Rouble/IOs/MainController.cs @@ -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; + } + } +} + diff --git a/Rouble/IOs/Rouble.csproj b/Rouble/IOs/Rouble.csproj new file mode 100644 index 0000000..5590255 --- /dev/null +++ b/Rouble/IOs/Rouble.csproj @@ -0,0 +1,108 @@ + + + + Debug + iPhoneSimulator + 10.0.0 + 2.0 + {0F5F2F1C-52CD-4DF6-84F7-223D5CCEAAE9} + {6BC8ED88-2882-458C-8E55-DFD12B67127B};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + Exe + Rouble + Resources + Rouble + + + true + full + false + bin\iPhoneSimulator\Debug + DEBUG; + prompt + 4 + false + None + Entitlements.plist + true + + + full + true + bin\iPhoneSimulator\Release + prompt + 4 + None + false + Entitlements.plist + + + true + full + false + bin\iPhone\Debug + DEBUG; + prompt + 4 + false + Entitlements.plist + true + iPhone Developer + + + full + true + bin\iPhone\Release + prompt + 4 + Entitlements.plist + false + iPhone Developer + + + full + true + bin\iPhone\Ad-Hoc + prompt + 4 + false + Entitlements.plist + true + Automatic:AdHoc + iPhone Distribution + + + full + true + bin\iPhone\AppStore + prompt + 4 + iPhone Distribution + Entitlements.plist + false + Automatic:AppStore + + + + + + + + + + + + + + + + + + + + + + + Resources\Rouble.ttf + + + \ No newline at end of file diff --git a/Rouble/Rouble.sln b/Rouble/Rouble.sln new file mode 100644 index 0000000..fe74d49 --- /dev/null +++ b/Rouble/Rouble.sln @@ -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 diff --git a/Rouble/Shared/Rouble.ttf b/Rouble/Shared/Rouble.ttf new file mode 100644 index 0000000..db2664f Binary files /dev/null and b/Rouble/Shared/Rouble.ttf differ