自定义导航栏的字体和颜色,只需要自定义一个lable,然后将lable添加到导航栏的titleview中就可以了 代码如下 UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0,0,0,0)];//这个frame是初设的,没关系,后
分类:
移动开发 时间:
2016-02-15 12:17:19
阅读次数:
223
关于手操作需要强调几点: UIImageView默认是不支持交互的,也就是userInteractionEnabled=NO ,因此要接收触摸事件(手势识别),必须设置userInteractionEnabled=YES(在iOS中UILabel、UIImageView的userInteractio
分类:
移动开发 时间:
2016-02-03 16:38:04
阅读次数:
668
//设置字间距 [self.label setColumnSpace:5]; //设置行间距 [self.label setRowSpace:5];
分类:
其他好文 时间:
2016-02-02 16:38:53
阅读次数:
152
之前做项目时遇到一个问题: 使用UITextView显示一段电影的简介,由于字数比较多,所以字体设置的很小,行间距和段间距也很小,一大段文字挤在一起看起来很别扭,想要把行间距调大,结果在XCode中查遍其所有属性才发现,UITextView居然没有调整行间距的接口,于是忍住不心里抱怨了一下下。 但是
分类:
移动开发 时间:
2016-01-31 13:21:13
阅读次数:
249
@interface MyTableViewCell : UITableViewCell @property (nonatomic, retain) UIImageView *headerImageView; @property (nonatomic, retain) UILabel *titleL
分类:
其他好文 时间:
2016-01-30 17:56:31
阅读次数:
239
/*
调整行间距
*/
+ (void)adjustLineSpacingOfLabel:(UILabel *)label to:(CGFloat)lineSpacing
{
NSString *textStr = label.text;
if (textStr.length <= 0) {
return;
}
NSMutableAtt...
分类:
其他好文 时间:
2016-01-30 02:55:18
阅读次数:
151
#import "ViewController.h" @interface SpecialLabel:UILabel @end @implementation SpecialLabel - (CGSize)sizeThatFits:(CGSize)size { CGSize s = [super s
分类:
其他好文 时间:
2016-01-30 01:55:14
阅读次数:
275
1.触摸事件 1 #import "ViewController.h" 2 @interface ViewController () 3 @property (strong,nonatomic) UILabel *simple; 4 @end 5 6 @implementation ViewCont
分类:
其他好文 时间:
2016-01-27 21:13:46
阅读次数:
119
IOS中自定义导航栏标题: UILabel *titleText = [[UILabel alloc] initWithFrame: CGRectMake(160, 0, 120, 50)]; titleText.backgroundColor = [UIColor clearColor]; tit...
分类:
移动开发 时间:
2016-01-27 14:38:41
阅读次数:
303
UIlabelUILabel * label = [[UILabel alloc] initWithFrame:CGRectMake(10,30, CGRectGetWidth(self.view.frame) -20, 200)]; //设置文字 label.text = @"欢迎收看灌篮高手.....
分类:
移动开发 时间:
2016-01-26 10:23:41
阅读次数:
221