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

posted @ 2016-03-15 11:50  zhen_zhen  阅读(154)  评论(0编辑  收藏  举报