iOS编程------UILabel
来源:互联网 发布:ubuntu chrome 闪烁 编辑:程序博客网 时间:2024/06/17 20:11
//// AppDelegate.h// UI01_UILabel//// Created by tanlon on 15/8/31.// Copyright (c) 2015年 . All rights reserved.//#import <UIKit/UIKit.h>@interface AppDelegate : UIResponder <UIApplicationDelegate>@property (strong, nonatomic) UIWindow *window;@end//// AppDelegate.m// UI01_UILabel//// Created by tanlon on 15/8/31.// Copyright (c) 2015年 . All rights reserved.//#import "AppDelegate.h"@interface AppDelegate ()@end@implementation AppDelegate- (void)dealloc{ [_window release]; [super dealloc];}- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; // Override point for customization after application launch. self.window.backgroundColor = [UIColor whiteColor]; [self.window makeKeyAndVisible]; //UILabel 主要用来展示一小段文字,起到说明作用,大段文字不使用UILabel,使用UITextView //UILabel 的使用分为创建,设置属性,添加,释放,四步. //UILabel属于UIView的子类,我们在API中查看一个类的使用时,如果该类有自己的初始化方法,就使用自己的初始化方法,如果没有,就使用父类的初始化方法. //1.创建UILabel UILabel *userNameLabel = [[UILabel alloc] initWithFrame:(CGRectMake(50, 50, 120, 50))]; //2.设置属性 userNameLabel.text = @"用户名 long long ago"; //设置文本 userNameLabel.textColor = [UIColor redColor]; //设置文本颜色 userNameLabel.font = [UIFont systemFontOfSize:18]; //设置文本字体 userNameLabel.lineBreakMode = NSLineBreakByCharWrapping; //设置换行模式 userNameLabel.numberOfLines = 0; //设置自动换行, 0 表示自动换行 userNameLabel.shadowColor = [UIColor purpleColor]; //阴影颜色 userNameLabel.shadowOffset = CGSizeMake(2, 2); //阴影偏移量 CGSize类型 //3.添加到父视图上 [self.window addSubview:userNameLabel]; //4.释放 [userNameLabel release]; return YES;}@end
0 0
- iOS编程------UILabel
- iOS界面编程-UILabel
- IOS-UILabel
- ios Uilabel
- IOS UILabel
- IOS(UILabel)
- IOS UILabel
- IOS-UILabel
- IOS UIlabel
- IOS UILabel
- iOS UILabel
- IOS UILabel
- IOS UILabel
- iOS组件之UILabel
- UILabel-IOS开发
- IOS控件UILabel总结
- IOS--UILabel 用法详解
- IOS#UI之UIlabel
- iOS动画加载图片
- 切割图片
- CSS动画学习
- C++使函数返回数组
- LintCode-主元素
- iOS编程------UILabel
- hdu5497删除一个序列的连续m个数使得逆序对数最少
- 学习笔记:Html浮动元素的定位
- hive启动报错: Found class jline.Terminal, but interface was expected
- 51nod 1084 更难的矩阵取数问题(DP)
- Matlab-vision包学习-Feature Detection,Extraction and Matching-MSER特征提取
- FreeSWITCH安装报错“You must install libyuv-dev to build mod_fsv”的解决方案
- IOS文章导航
- 一道类加载相关的题目