一,效果图。 二,工程图。 三,代码。 ViewController.h #import <UIKit/UIKit.h> @interface ViewController : UIViewController @end ViewController.m #import "ViewControlle ...
分类:
其他好文 时间:
2016-06-15 10:49:29
阅读次数:
220
一、创建工程、添加语言 二、将文本从代码中分离: 目前,应用展示的所有文本都是以硬编码字符串存在于Main.storyboard 和 ViewController里。为了本地化这些字符串,你需要把它们放在一个单独的文件中。他将会在包中简单地引用这些字符串,而不是在你的方法中进行硬编码。Xcode使用 ...
分类:
移动开发 时间:
2016-06-12 20:18:20
阅读次数:
342
一、程序国际化 准备工作: 1、首先我们要先创建一个工程,我们给他命名Internationalization-Demo,然后添加语言。 从代码中分离文本: 目前,应用展示的所有文本都是以硬编码字符串存在于Main.storyboard 和 ViewController里。为了本地化这些字符串,你需 ...
分类:
移动开发 时间:
2016-06-12 10:39:05
阅读次数:
208
从VC取得View很容易,但有些情况下我们需要从View反向获取VC.不过在一些特殊的场合,Cocoa库帮我们想的很周到,比如在自定义View过渡动画的时候:func animateTransition(transitionContext: UIViewControllerContextTransitioning) {}系统在回调我们的animateTransition方法时,会传入一个contex...
分类:
编程语言 时间:
2016-06-11 10:39:04
阅读次数:
341
在使用xcode7 在storyboard中添加autolayout中发现 如果添加在view 直接添加到viewcontroller的view 上 constrain to margins 只有左右20point的 如果view(viewB)没有直接添加到viewcontroller的view上而 ...
分类:
其他好文 时间:
2016-06-11 10:34:39
阅读次数:
1092
TouchJSON是OC转换JSON的一个第三方类库,使用简单。在GitHub上可以轻松获取:TouchJSON 以下是简单的事例演示从douban movie请求JSON数据并转为字典对象后对控件赋值。 #import "ViewController.h" #import "CJSONSerial ...
分类:
Web程序 时间:
2016-06-10 17:44:03
阅读次数:
192
#import "ViewController.h" #import "LhbToolBar.h" @interface ViewController ()<LhbToolBarDelegate> @property (weak, nonatomic) IBOutlet UITextField *t ...
分类:
其他好文 时间:
2016-06-09 19:45:37
阅读次数:
185
首先实现 设置代理,self.textfield.delegate = self; ...
分类:
移动开发 时间:
2016-06-08 18:37:15
阅读次数:
191
Account.h Account.m Person.h Person.m ViewController.m ...
分类:
移动开发 时间:
2016-06-08 15:50:42
阅读次数:
196
转自:http://blog.sina.com.cn/s/blog_801997310101a39w.html 一、ViewController的职责 对内管理与之关联的View,对外跟其他ViewController通信和协调。对于与之关联的View,ViewController总是在需要的时候才 ...
分类:
移动开发 时间:
2016-06-08 00:13:03
阅读次数:
258