zoukankan      html  css  js  c++  java
  • iOS UI01_Label

    @implementation AppDelegate

    -(void)dealloc

    {

        [_window release];

        [superdealloc];

    }


    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

        self.window = [[UIWindowalloc]initWithFrame:[[UIScreenmainScreen]bounds]];

        // Override point for customization after application launch.

        self.window.backgroundColor = [UIColorwhiteColor];

        [self.windowmakeKeyAndVisible];

        [_window release];

        

         //UILabel显示文本内容

        UILabel *label=[[UILabelalloc]initWithFrame:CGRectMake(100, 100, 200, 150)];

        label.backgroundColor=[UIColorcyanColor];

        [self.windowaddSubview:label];

        [labelrelease];

        // 设置文本内容

        label.text=@"学习iOS! ! !";

        //文本内容颜色

        label.textColor=[UIColoryellowColor];

        //文本对齐方式

        label.textAlignment=NSTextAlignmentCenter;

        // 字体大小

        label.font=[UIFontsystemFontOfSize:25];

        // 设置行数

        // 0是行数的最大值

        label.numberOfLines=3;

        //让文本自己去适应尺寸

    //    [label sizeToFit];

        //断行模式

        label.lineBreakMode=NSLineBreakByTruncatingMiddle;

        //阴影颜色

        label.shadowColor=[UIColorredColor];

        

        //阴影大小

        label.shadowOffset=CGSizeMake(2, 1);

        

        //设置边框

        label.layer.borderWidth=1;

        //设置圆角

        label.layer.cornerRadius=100;

        label.layer.masksToBounds=YES;

        // 中心点的位置  center能够改动视图的位置  frame能够改动尺寸

        label.frame=CGRectMake(100, 100, 200, 200);

        label.center =CGPointMake(200, 200);

        


        return YES;

    }


  • 相关阅读:
    使用awrrpt.sql 生成AWR报告
    oracle简单物化视图
    oracle 查询重复内容
    windows server 2008 服务器 oracle11g降级oracle10g遇到的种种问题
    简单js条码生成器
    tomcat服务器禁用非post、get方法的坑
    委托和事件
    消息队列(Message Queue)简介及其使用
    架构师修炼之道
    Xcode7 使用NSurl发送HTTP请求报错
  • 原文地址:https://www.cnblogs.com/yxysuanfa/p/7373042.html
Copyright © 2011-2022 走看看