![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
iOS新手入门
harnican
没写出想要的代码,就不要去睡觉
展开
-
iOS新手入门之UITextField
// 创建一个UITextField UITextField *textField = [[UITextField alloc] initWithFrame:CGRectMake(100, 100, 200, 50)]; // 设置背景颜色 textField.backgroundColor = [UIColor greenColor]; // 设置占位符(输入框内直接显示出来的文本 如:输入原创 2015-10-07 14:57:03 · 223 阅读 · 0 评论 -
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 阅读 · 0 评论 -
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 阅读 · 0 评论 -
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 阅读 · 0 评论 -
iOS新手入门之点击空白处回收键盘
点击空白处实现键盘回收首先需要建一个与屏幕等大的UIView, 然后把这个UIView添加到这个屏幕上, 把创建的UITextField作为UIView的子视图(添加到UIView上)#import "AppDelegate.h"// 定义宏 设置成与屏幕等宽 方便使用原创 2015-10-07 16:38:11 · 666 阅读 · 0 评论 -
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 阅读 · 0 评论