【问题标题】:iOS - add padding to subviewiOS - 向子视图添加填充
【发布时间】:2014-10-21 09:41:50
【问题描述】:

我将 Tapkul 日历添加到我的项目中,但由于它与 iphone 时间混合 如何向我的子视图(日历)添加一些填充

在这里我的代码将它添加到我的项目中

  calendar =  [[TKCalendarMonthView alloc] init];
    calendar.delegate = self;
    calendar.dataSource = self;
    calendar.frame = CGRectMake(0, 0,  320,400);


[self.view addSubview:calendar];

任何建议

【问题讨论】:

    标签: ios objective-c xcode tapku


    【解决方案1】:

    这个怎么样?

    calendar.frame = CGRectMake(0, 20,  320,400);
                                   ^
    -------------------------------|
    

    【讨论】:

      【解决方案2】:

      像这样使用CGRectInset

      calendar.bounds = CGRectInset(calendar.frame, 10.0f, 10.0f);
      

      【讨论】:

      • 更改绑定到边界
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-01-29
      • 2011-12-15
      • 2019-07-31
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多