摘要: + (UIFont *)flatFontOfSize:(CGFloat)size { static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ NSURL * url = [[NSBundle mainBundle] URLForResource:@"Lato-Regular" withExtension:@"ttf"]; CFErrorRef error; CTFontManagerRegisterFontsForURL((__bridge CFURLRef)url, k... 阅读全文
posted @ 2014-03-20 17:28 784692237 阅读(560) 评论(0) 推荐(0)
摘要: 判断iphone或者ipadself.window = [[[UIWindowalloc] initWithFrame:[[UIScreenmainScreen] bounds]] autorelease]; if ([[UIDevicecurrentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) { self.viewController = [[[SendMsgToWeChatViewControlleralloc] initWithNibName:@"ViewController_iPhone"bun 阅读全文
posted @ 2014-03-20 16:24 784692237 阅读(514) 评论(0) 推荐(0)
摘要: 步骤一:设置scrollView的代理步骤二:让控制器遵守UIScrollView的协议步骤三:实现UIScrollView协议的缩放方法。步骤四:设置UIScrollView的最大和最小缩放比例。步骤五: 按option键 对图片进行伸缩。 阅读全文
posted @ 2014-03-20 15:07 784692237 阅读(392) 评论(0) 推荐(0)
摘要: 函数的返回值也可以是引用,例如:double heights[] = {10.9, 18.7, 28.9, 67.44};double & setHeights(int i){ return heights[i];}int main (int argc, const char * argv[]){ cout<<heights[0]<<endl; setHeights[0] = 20.7;//调用setHeights函数,返回heights[i]的引用,然后进行赋值 cout<< heights[0] <<endl;}如果函数返回的是引用, 阅读全文
posted @ 2014-03-20 11:50 784692237 阅读(366) 评论(0) 推荐(0)