2016-08-19 92 views
1

我需要對我的ePub書進行一些自定義。我想知道是否有可能瞭解UIWebView如何在頁面上分開?我知道ho以編程的方式讓我想知道它是如何在UIWebView中實現的。 也許它增加了一些標籤(「div」或可能是別的什麼)來達到這樣的效果? 我知道它不是開放源代碼的組件,但我只提出任何建議來做出我的進一步決定。UIWebView如何實現分頁?

聽到我把一個圖像我的意思。

enter image description here

回答

-1
arrHtmlPage=[[NSMutableArray alloc] initWithObjects:@"2",@"3",@"5",@"6",@"8",@"9",@"11",@"13",nil]; 

NSBundle *bundle = [NSBundle mainBundle]; 

NSString *htmlTemplateLink = [bundle pathForResource:@"2" ofType:@"htm"]; 

NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL fileURLWithPath:htmlTemplateLink]]; 

wview=[[UIWebView alloc]initWithFrame:CGRectMake(0, 0, 768, 940)]; 
wview.scalesPageToFit = YES; 
[wview loadRequest:request]; 
wview.delegate=self; 

wview.userInteractionEnabled=YES; 

[self.view addSubview:wview]; 

而且這樣做也

typedef NS_ENUM(NSInteger, UIWebPaginationMode) { 
UIWebPaginationModeUnpaginated, 
UIWebPaginationModeLeftToRight, 
UIWebPaginationModeTopToBottom, 
UIWebPaginationModeBottomToTop, 
UIWebPaginationModeRightToLeft 
}