贴一段我很久以前写的小demo,你们就明白了,是把textField套在alertView里的@interface ViewController : UIViewController { UILabel *la; UITextField *myTextField;}@implementa...
分类:
移动开发 时间:
2014-07-16 21:26:11
阅读次数:
282
#import "ViewController.h"@interface ViewController ()@property (weak, nonatomic) IBOutlet UILabel *show;@end@implementation ViewController - (voi...
分类:
其他好文 时间:
2014-07-16 20:41:43
阅读次数:
186
1、利用xcode6控件搭成计算器界面2、程序#import "ViewController.h"@interface ViewController (){ float result; int i;}@property (weak, nonatomic) IBOutlet UILabel *lab....
分类:
其他好文 时间:
2014-07-16 20:31:06
阅读次数:
334
加粗loginLabel.font = [UIFont fontWithName:@"Helvetica-Bold" size:20];加粗并且倾斜loginLabel.font = [UIFont fontWithName:@"Helvetica-BoldOblique" size:20];
分类:
其他好文 时间:
2014-07-16 19:51:14
阅读次数:
201
//IOS7.0中利用- (CGRect)boundingRectWithSize:(CGSize)size options:(NSStringDrawingOptions)options attributes:(NSDictionary *)attributes context:(NSString...
分类:
移动开发 时间:
2014-07-13 11:31:16
阅读次数:
209
1. [代码][C/C++]代码 //创建uilabelUILabel *label1 = [[UILabel alloc] initWithFrame:CGRectMake(20, 40, 280, 80)];//设置背景色label1.backgroundColor = [UIColor gr....
分类:
移动开发 时间:
2014-07-07 18:50:59
阅读次数:
212
1 textAlignment有三种设置方式:(以UI开头,是ios6之前的用法) (1) NSTextAlignmentLeft 为向左对齐 (2) NSTextAlignmentCenter 为居中对齐 (3) NSTextAlignmentRight 为向右对齐2 linBr...
分类:
移动开发 时间:
2014-07-07 11:39:31
阅读次数:
664
1 //创建label UILabel*label=[[UILabelalloc]initWithFrame:CGRectMake(0,0,0,0)]; 2 //文本 NSString*string =@"11111111122222222233333333"; UIFont*font=[U...
分类:
移动开发 时间:
2014-07-07 11:33:02
阅读次数:
232
.h文件
#import
@interface UILabel (ContentSize)
- (CGSize)contentSize;
@end
.m文件
#import "UILabel+ContentSize.h"
@implementation UILabel (ContentSize)
- (CGSize)contentSize {
NSMutablePa...
分类:
移动开发 时间:
2014-07-02 09:50:21
阅读次数:
223
准备:字体文件(.ttf,.odf)方法1: 添加对应的字体(.ttf或.odf)到工程的resurce,使用cocos2d中的FontLabel库,FontLabel继承于UILabel,象UILabel一样使用就好了 fontName直接使用添加的资源名字即可方法2: 1.添加对应的字体(...
分类:
移动开发 时间:
2014-07-01 00:24:17
阅读次数:
241