//
// AppDelegate.m
// UI01_UILabel
//
// Created by dllo on 15/7/10.
// Copyright (c) 2015年 dllo. All rights reserved.
//
#import "AppDelegate.h"
@interface AppDelegate ()
@end
@implementation AppDelegate
- (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];
#pragma mark - 知识点2 UILabel
/* 创建label对象 */
UILabel *userLabel = [[UILabel alloc] initWithFrame:CGRectMake(40, 100, 300, 200)];
userLabel.backgroundColor = [UIColor yellowColor];
[self.window addSubview:userLabel];
/* 设置相关的属性(常用API), attribute text调研 */
userLabel.text = @"用户名户名用户名名用名:";
/* font 属性, UIFont类, 调研一下(如何更改字体, 如何加载第三方字体) */
userLabel.font = [UIFont systemFontOfSize:26];
/* 文本颜色 调研一下(自定义颜色)*/
userLabel.textColor = [UIColor darkGrayColor];
/* 对齐方式 */
userLabel.textAlignment = NSTextAlignmentRight;
/* 断行模式(省略) */
userLabel.lineBreakMode = NSLineBreakByTruncatingMiddle;
/* 行数设置(设置为0:不受行数限制, 并且不会超过labele的限制) */
userLabel.numberOfLines = 0;
/* 阴影设置 */
userLabel.shadowColor = [UIColor redColor];
userLabel.shadowOffset = CGSizeMake(0, 2);
[userLabel release];
[_window release];
return YES;
}
@endUI编程_UILabel及其属性
最新推荐文章于 2025-08-16 16:38:42 发布
本文详细介绍了UILabel的基本使用方法,包括创建UILabel对象、设置字体大小、文本颜色、对齐方式、断行模式、行数限制及阴影效果等。通过具体实例展示了UILabel在iOS应用中的布局和样式配置。
部署运行你感兴趣的模型镜像
您可能感兴趣的与本文相关的镜像
ACE-Step
音乐合成
ACE-Step
ACE-Step是由中国团队阶跃星辰(StepFun)与ACE Studio联手打造的开源音乐生成模型。 它拥有3.5B参数量,支持快速高质量生成、强可控性和易于拓展的特点。 最厉害的是,它可以生成多种语言的歌曲,包括但不限于中文、英文、日文等19种语言

959

被折叠的 条评论
为什么被折叠?



