控件获取有两种方式:1. IBOutlet:直接拖拽需要的控件到界面设计文件 *.h 的@interface和@end之间2. Tag:设置tag为12,通过如下代码获取lableUILabel* lable = (UILabel*) [self.view viewWithTag:12];but.....
分类:
移动开发 时间:
2014-09-18 18:46:34
阅读次数:
241
#import "ViewController.h"@interface ViewController (){ char op1; NSString *op3, *op4;}@property (weak, nonatomic) IBOutlet UILabel *resultLabe...
分类:
其他好文 时间:
2014-09-17 21:45:22
阅读次数:
218
#import "ViewController.h"@interface ViewController ()@property (weak, nonatomic) IBOutlet UILabel *resultLabel;@end NSString *op1,*op2,*result; ch...
分类:
其他好文 时间:
2014-09-17 21:43:52
阅读次数:
344
使用YXHUD这是本人自己设计的一个类,但功能很不完善,先看看效果:源码:YXHUD.h 与YXHUD.m//// YXHUD.h// UILabel//// Created by YouXianMing on 14-9-16.// Copyright (c) 2014年 YouXianMi...
分类:
其他好文 时间:
2014-09-16 21:53:51
阅读次数:
275
一般的我们都是通过自定义视图来设置导航条的title颜色和字体的
UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 100, 40)];
titleLabel.text = @"详情";
titleLabel.textColor = [UIColor whiteColor];
titl...
分类:
移动开发 时间:
2014-09-16 15:56:40
阅读次数:
183
如图绿蓝框所示,UILabel显示名字,Label框随名字长短而自适应,后面的性别图片跟在其后显示分两部分:第一部分先布局//名字 self.nameLab = [[UILabel alloc]initWithFrame:CGRectMake(0, 200, SCREEN_WIDTH, 20)];....
分类:
移动开发 时间:
2014-09-15 15:49:39
阅读次数:
350
详解UILabel的adjustsFontSizeToFitWidth值UILabel有一个属性值,叫adjustsFontSizeToFitWidth,看着名字就知道,他是用来让文字自动适应UILabel宽度的。先看看显示效果:测试用源码://// RootViewController.m// ....
分类:
其他好文 时间:
2014-09-14 23:17:37
阅读次数:
282
文字凹陷效果UILabel*label = [[UILabelalloc]initWithFrame:CGRectMake(10,10,300,100)];label.text=@"文字凹陷效果";label.shadowColor= [UIColorcolorWithRed:0.855green:...
分类:
移动开发 时间:
2014-09-12 16:50:33
阅读次数:
146
#import "newDetailViewController.h"
#import "Common.h"
#import "newObject.h"
#import "NetRequest.h"
#import
@interface newDetailViewController ()
{
UILabel *GWDetailTitleText;
UILabel *GWDe...
分类:
其他好文 时间:
2014-09-12 13:35:33
阅读次数:
299
code中默认的UILabel是垂直居中对齐的,如果你的UILabel高度有多行,当内容少的时候,会自动垂直居中。比较郁闷的是,UILabel并不提供设置其垂直对齐方式的选项。所以如果你想让你的文字顶部对齐,那么就需要自己想办法了。stackoverflow.com上提供了几种方法来达到顶部对齐的效...
分类:
移动开发 时间:
2014-09-10 21:02:41
阅读次数:
196