2

私は、このコードで保存されたhtmlページまたはpdfまたはその他のドキュメントをロードしているwebviewcontrollerを持っています。

[webView loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"yahoo" ofType:@"html"]isDirectory:YES]]];

ドキュメントを読み込んで、垂直スクロールではなく水平スクロールを使用して表示しようとしています。

誰かがこれを行う方法を手伝ってくれますか。

ありがとう

4

3 に答える 3

0

これをあなたのページに追加してください -

<link media="only screen and (max-width: 1000px)"
  rel="stylesheet" type="text/css" href="iphone.css"/>

ニーズに合わせてページ幅を広げることができます

于 2011-04-05T05:22:15.063 に答える
0

最初にビューを水平に作成し、次にそのドキュメントをこのビューにロードします..次に、水平にスクロールできます....

UIScrollView *scroll = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];  
scroll.pagingEnabled = YES;  
NSInteger numberOfViews = 3;  
for (int i = 0; i < numberOfViews; i++) {  
CGFloat yOrigin = i * self.view.frame.size.width;  
UIView *awesomeView = [[UIView alloc] initWithFrame:CGRectMake(yOrigin, 0,   self.view.frame.size.width, self.view.frame.size.height)];  
awesomeView.backgroundColor = [UIColor colorWithRed:0.5/i green:0.5 blue:0.5 alpha:1];  
[scroll addSubview:awesomeView];  
[awesomeView release];
}
scroll.contentSize = CGSizeMake(self.view.frame.size.width * numberOfViews,   self.view.frame.size.height);  
[self.view addSubview:scroll];  

[for more details][1]


  [1]: http://idevzilla.com/2010/09/16/uiscrollview-a-really-simple-tutorial/
于 2011-04-05T05:32:36.250 に答える