zoukankan      html  css  js  c++  java
  • 2016-03-15 scrollview 与label

     //gzz0315

        UIScrollView *Scrview = [[UIScrollView alloc]initWithFrame:CGRectMake(0,0,SCREEN_WIDTH, SCREEN_HEIGHT

                                                                              )];

        Scrview.delegate = self;

    //    scrView=Scrview;

        Scrview.showsVerticalScrollIndicator=NO;

        Scrview.showsVerticalScrollIndicator=NO;

        Scrview.contentOffset = CGPointMake(0, 0);

        Scrview.contentSize = CGSizeMake(0, 568);

        //    Scrview.contentSize = CGSizeMake(0, 568+40);  0121

        

        [self.view addSubview:Scrview];

        

        

        UILabel *detailLabel=[[UILabel alloc]initWithFrame:CGRectMake(15, 20, SCREEN_WIDTH-30, 0)];

        

        [Scrview addSubview:detailLabel];

        

        

        detailLabel.numberOfLines = 0;

        detailLabel.lineBreakMode = NSLineBreakByWordWrapping;

        NSString *str11=[NSString stringWithFormat:@"%@",[_probledeDic objectForKey:@"content"]];

        detailLabel.text=str11;

    //    donateExcontent.text=@"尊敬的爱心捐助者:       予人玫瑰,手有余香!本平台架起各种形式的捐助桥梁,您可以留下姓名及联系方式 ,我们的工作人员会和您联系确认。我们收到的每一笔款项或物品,均会按照正规流程捐赠到吴阶平医学基金会或相关基金会,我们会监督每一笔款项或物品的使用情况并与您保持沟通。敬请放心!";//gzz0307

        

        //内容待定   捐助说明

        CGSize size = [detailLabel sizeThatFits:CGSizeMake(detailLabel.frame.size.width, MAXFLOAT)];

        detailLabel.frame =CGRectMake(15, 20,SCREEN_WIDTH-30, size.height);

        

        detailLabel.font = [UIFont systemFontOfSize:13];

        detailLabel.textColor=RGB(134, 134, 134);

        

        [detailLabel sizeToFit];

        

        Scrview.frame=CGRectMake(Scrview.x, Scrview.y, Scrview.width, CGRectGetMaxY(detailLabel.frame)+15);

        Scrview.contentSize=CGSizeMake(0, CGRectGetMaxY(detailLabel.frame)+20);

  • 相关阅读:
    【java】一维数组循环位移方阵
    【java】for循环输出数字金字塔
    C++编程tips
    C++中cin.get 和cin.peek 及其相关的用法
    ubuntu增加字符设备驱动程序/ 操作系统课程设计
    C++ Primer 学习笔记/ 处理类型
    C++学习,顶层const
    C++学习笔记/const和指针
    ubuntu16.04增加系统调用(拷贝)
    Java学习笔记#数组 循环遍历
  • 原文地址:https://www.cnblogs.com/gzz2016/p/5278791.html
Copyright © 2011-2022 走看看