UI问题与kal日历为ipad? [英] UI Issue with kal calendar for ipad?

查看:164
本文介绍了UI问题与kal日历为ipad?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有iPad版的Kal Calendar的UI问题。在iPad上有一个空的空间,但在iPhone上它的罚款。

I have UI issue with Kal Calendar for iPad. On the iPad there is an empty space but on the iPhone it's fine. How can i get it to fit in the frame on the iPad?

if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
{
    [kal.view setFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
}
else if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
{
    [kal.view setFrame:CGRectMake(0, 0,768 ,1004)];

}

我试图使用上面列出的代码,但它没有为我工作!

I tried to use the code listed above but it did not work for me!

/ p>

推荐答案

在KalGridView.m中你会找到这个。

in KalGridView.m you'll find this.

const CGSize kTileSize = { 46.f, 44.f };

我将代码更改为属性,您可以将框架动态设置为idiom和/或方向。

I'd change the code to a property where you can set the frame dynamically to the idiom and/or orientation.

在KalGridView.m

in KalGridView.m

 const CGSize kTileSize = { 109.0f, 109.0f };

和KalView.m

and in KalView.m

- (void)addSubviewsToHeaderView:(UIView *)headerView

  …

  for (CGFloat xOffset = 0.f; xOffset < headerView.width; xOffset += 109.f, i = (i+1)%7) {
    CGRect weekdayFrame = CGRectMake(xOffset, 30.f, 109.f, kHeaderHeight - 29.f);
    UILabel *weekdayLabel = [[UILabel alloc] initWithFrame:weekdayFrame];
    weekdayLabel.backgroundColor = [UIColor clearColor];
    weekdayLabel.font = [UIFont boldSystemFontOfSize:10.f];
    weekdayLabel.textAlignment = UITextAlignmentCenter;
    weekdayLabel.textColor = [UIColor colorWithRed:0.3f green:0.3f blue:0.3f alpha:1.f];
    weekdayLabel.shadowColor = [UIColor whiteColor];
    weekdayLabel.shadowOffset = CGSizeMake(0.f, 1.f);
    weekdayLabel.text = [weekdayNames objectAtIndex:i];
    [headerView addSubview:weekdayLabel];
    [weekdayLabel release];
  }
}

结果:

这篇关于UI问题与kal日历为ipad?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆