zoukankan      html  css  js  c++  java
  • 一个尺寸一个尺寸的 量,差点死在拉伸上面,

       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;

  • 相关阅读:
    POJ1321 棋盘问题
    HDU1234 开门人和关门人(解法二)
    HDU1234 开门人和关门人(解法二)
    HDU1996 汉诺塔VI
    HDU1996 汉诺塔VI
    HDU1013 POJ1519 Digital Roots(解法二)
    HDU1013 POJ1519 Digital Roots(解法二)
    HDU4548 美素数
    HDU4548 美素数
    POJ3751 时间日期格式转换【日期计算】
  • 原文地址:https://www.cnblogs.com/guligei/p/3036081.html
Copyright © 2011-2022 走看看