- 博客(9)
- 收藏
- 关注
原创 placeholder设置字体大小与颜色
很简单就能实现 [textField setValue:[UIColor greenColor] forKeyPath:@"_placeholderLabel.textColor"]; [textField setValue:[UIFont boldSystemFontOfSize:13] forKeyPath:@"_placeholderLabel.font"];
2017-08-09 18:02:17
1047
原创 ios成长之路 Navigation的统一布局
项目中都会有自己风格的返回键,重写方法可以不用每个页面都去写一次// 统一设置标题颜色+(void)initialize{[[UINavigationBar appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObject:[UIColor whiteColor] forKey:UITextAttributeTextCol
2017-07-22 17:03:55
384
原创 ios新手入门之UITextField左边空格
// UITextField输入开始时,左边回空出一小段距离,看起来比较好UILabel * leftView = [[UILabel alloc] initWithFrame:CGRectMake(15,0,7,26)];leftView.backgroundColor = [UIColor clearColor];self.textF.leftView = leftView;self.tex
2017-07-22 16:31:35
827
原创 iOS新手入门之点击空白处回收键盘
点击空白处实现键盘回收首先需要建一个与屏幕等大的UIView, 然后把这个UIView添加到这个屏幕上, 把创建的UITextField作为UIView的子视图(添加到UIView上)#import "AppDelegate.h"// 定义宏 设置成与屏幕等宽 方便使用
2015-10-07 16:38:11
666
原创 iOS新手入门之UITextField
// 创建一个UITextField UITextField *textField = [[UITextField alloc] initWithFrame:CGRectMake(100, 100, 200, 50)]; // 设置背景颜色 textField.backgroundColor = [UIColor greenColor]; // 设置占位符(输入框内直接显示出来的文本 如:输入
2015-10-07 14:57:03
223
原创 iOS新手入门之UIButton
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];// 设置button的位置以及大小button.frame = CGRectMake(100, 100, 100, 100);// 设置按钮(button)的背景颜色button.backgroundColor = [UIColor grayColor];
2015-10-07 11:27:46
235
原创 iOS新手入门之UILable
UILable可以在上面显示字体#import "AppDelegate.h"@interface AppDelegate ()@end@implementation AppDelegate- (void)dealloc{ [_window release]; [super dealloc];}- (BOOL)application:(UIApplication *)applic
2015-10-07 11:06:07
351
原创 iOS新手入门之UIView
#import "AppDelegate.h"// 获取屏幕的高度 宽度// 自定义宏#define kScreenWidth [UIScreen mainScreen].bounds.size.width#define kScreenHeight [UIScreen mainScreen].bounds.size.height@interface AppDelegate ()@end@imp
2015-10-07 10:40:03
280
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人