More Related Content Similar to CakePHP in iPhone App (20) More from Akihiro Matsuura (16) CakePHP in iPhone App2. About Me
•
• Blog : Sun Limited Mt.
http://www.syuhari.jp/blog/
• Twitter : @syuhari
8. - (id)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
webView = [[UIWebView alloc] initWithFrame:CGRectZero];
webView.opaque = NO;
webView.alpha = 0.8f;
webView.backgroundColor = [UIColor clearColor];
[self addSubview:webView];
}
return self;
}
- (void)setFrame:(CGRect)rect {
[super setFrame:CGRectMake(0, 0, rect.size.width, 320)];
self.center = CGPointMake(480/2, 320/2);
}
- (void)layoutSubviews {
CGFloat buttonTop;
for (UIView *view in self.subviews) {
if ([[[view class] description] isEqualToString:@"UIThreePartButton"]) {
view.frame = CGRectMake(view.frame.origin.x,
self.bounds.size.height - view.frame.size.height - 15,
view.frame.size.width, view.frame.size.height);
buttonTop = view.frame.origin.y;
}
}
buttonTop -= 7;
buttonTop -= 100;
webView.frame = CGRectMake(12, 35, self.frame.size.width - 53, 220);
NSString* path=[[NSBundle mainBundle] pathForResource:@"default" ofType:@"html"];
NSURL* url=[NSURL fileURLWithPath:path];
[webView loadRequest:[NSURLRequest requestWithURL:url]];
[webView loadRequest:
[NSURLRequest requestWithURL:[NSURL URLWithString:
[NSString stringWithFormat:RANKING_URL, GAME_ID]]]];
}
Editor's Notes アンケート
・iPhone 持っている方
・iPhone アプリを開発したことがある方 Webアプリケーション Safari + HTML5, JavaScript, PHP,
ネイティブアプリケーション AppStore, Objective-C ランキングシステム
XML パース面倒
JSON いいけど、結局表示部分って面倒
ランキング表示は HTML で!