一个尺寸一个尺寸的 量,差点死在拉伸上面,

   Rules *rules = [Rules getRulesFromDic:JSON];

             if (rules.changeRule) {

                 self.alertTitleImageView.frame = CGRectMake(0, 0, 320, 40);

                  self.bigTitleLabel.frame = CGRectMake(15, 9, 96, 21);

                 self.cancelTitleLabel.frame = CGRectMake(self.cancelTitleLabel.frame.origin.x, self.alertTitleImageView.frame.size.height, self.cancelTitleLabel.frame.size.width, 21);

                 self.lineZeroImageView.frame = CGRectMake(self.lineZeroImageView.frame.origin.x, self.cancelTitleLabel.frame.origin.y+self.cancelTitleLabel.frame.size.height, LINEWIDTH, 1);

                 

                 UIFont *font = [UIFont systemFontOfSize:12.0];

                 CGSize cancelContentSize = [rules.cancelRulesizeWithFont:font constrainedToSize:CGSizeMake(self.lineTwoImageView.frame.size.width, 65) lineBreakMode:UILineBreakModeWordWrap];

                  self.cancelLabel.frame = CGRectMake(self.cancelLabel.frame.origin.x, self.lineZeroImageView.frame.origin.y + 2, cancelContentSize.width, cancelContentSize.height);

                 

                 self.lineOneImageView.frame = CGRectMake(self.cancelLabel.frame.origin.x, self.cancelLabel.frame.origin.y + self.cancelLabel.frame.size.height, LINEWIDTH, 1);

                 self.changeTitleLabel.frame = CGRectMake(self.lineOneImageView.frame.origin.x, self.lineOneImageView.frame.origin.y + 2, self.lineOneImageView.frame.size.width, 21);

                 self.lineTwoImageView.frame = CGRectMake(self.changeTitleLabel.frame.origin.x, self.changeTitleLabel.frame.origin.y +self.changeTitleLabel.frame.size.height, LINEWIDTH, 1);

                 

                 

                 CGSize changeContentSize = [rules.changeRulesizeWithFont:font constrainedToSize:CGSizeMake(self.lineTwoImageView.frame.size.width, 65) lineBreakMode:UILineBreakModeWordWrap];

                 self.changeLabel.frame = CGRectMake(self.lineTwoImageView.frame.origin.x, self.lineTwoImageView.frame.origin.y + 2, changeContentSize.width, changeContentSize.height);

                 

                 self.lineThreeImageView.frame = CGRectMake(self.changeLabel.frame.origin.x, self.changeLabel.frame.origin.y +self.changeLabel.frame.size.height, LINEWIDTH, 1);

                 self.switchTitleLabel.frame = CGRectMake(self.lineThreeImageView.frame.origin.x, self.lineThreeImageView.frame.origin.y + 2, self.lineThreeImageView.frame.size.width, 21);

                  self.lineFourImageView.frame = CGRectMake(self.switchTitleLabel.frame.origin.x, self.switchTitleLabel.frame.origin.y +self.switchTitleLabel.frame.size.height, LINEWIDTH, 1);

                  self.switchLabel.frame = CGRectMake(self.lineFourImageView.frame.origin.x, self.lineFourImageView.frame.origin.y +self.lineFourImageView.frame.size.height, self.switchLabel.frame.size.width, self.switchLabel.frame.size.height);

                 

                 self.rulesView.frame = CGRectMake(self.rulesView.frame.origin.x, self.rulesView.frame.origin.y, self.rulesView.frame.size.width, self.switchLabel.frame.origin.y + self.switchLabel.frame.size.height);

                 self.rulesView.hidden = NO;

                 self.transparentView.hidden = NO;

             }

             self.cancelLabel.text = rules.cancelRule;

             self.changeLabel.text = rules.changeRule;

posted @ 2013-04-22 17:39  路在脚下,  阅读(162)  评论(0编辑  收藏  举报