uiwebview

Content in UIWebView on iOS 3.1.3 appears zoomed on but on iOS 4.3 appears fine

雨燕双飞 提交于 2019-12-02 04:38:06
I am running into a difference in UIWebView behaviour on two different devices I am testing. First here is the listing of devices I am testing with... Device #1 -> iPod 2G / iOS 3.1.3 Device #2 -> iPhone 4 / iOS 4.3 I have the same HTML content being loaded on both devices but when it's loaded on the iPod the content appears zoomed in. On the iPhone the content appears correctly. From what I know I think this may have to do with retina display and perhaps the iPhone can natively accept content at a larger resolution but I have nothing confirmed at the moment. Wondering if anyone has

How to change UIWebView orientation programmatically in Swift

限于喜欢 提交于 2019-12-02 04:09:33
I've created UIWebView programmatically. Now i want to set programmatically its orientation to (landscape or portrait). Please can anyone tell me how i can do this? Thanks import UIKit class ViewController: UIViewController, UIWebViewDelegate { override func viewDidLoad() { super.viewDidLoad() let webV:UIWebView = UIWebView(frame: CGRectMake(0, 0, UIScreen.mainScreen().bounds.width, UIScreen.mainScreen().bounds.height)) webV.loadRequest(NSURLRequest(URL: NSURL(string: "http://tune.tv/humtv-live-embed")!)) webV.delegate = self; self.view.addSubview(webV) } } In your viewDidAppear add the

UIWebView content not adjusted to new frame after rotation

依然范特西╮ 提交于 2019-12-02 04:08:48
问题 I have an e-mail application, which shows the content in an UIWebView inside an UISplitViewController . Everything works fine until i rotate the device, when already zoomed in/out in the UIWebView . When rotating the device, i adjust the frame of the UIWebView in - (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration The problem is, when i zoomed in/out in the UIWebView and then rotate the device. The content isn't

Identify submit button click of UIWebview

亡梦爱人 提交于 2019-12-02 04:06:52
I have a UIWebView page with multiple button . Need to identify which button is clicked of the UIWebView. Page source for UIWebview load contents: <form action="settings_personal.php" data-ajax="false" method="post"> <input type="submit" name ="btn_settings_personal" value=" Goals (Personal data) " data-icon="star" data-theme="g" /> </form> <form action="settings_global.php" data-ajax="false" method="post"> <input type="submit" name ="btn_settings_global" value=" Settings " data-icon="gear" data-theme="g" /> </form> <form action="" data-ajax="false" method="post"> <input type="submit" name =

I have two error : No visible @interface for 'UIWebview'

自闭症网瘾萝莉.ら 提交于 2019-12-02 03:06:20
问题 I have two error :No visible @interface for 'UIWebView' declares the selector 'highlightAllOccurencesOfString:' another one:No visible @interface for 'UIWebView' declares the selector 'removeAllHighlights' Please someone help me. WBSecondViewController.h #import <UIKit/UIKit.h> @interface WBSecondViewController : UIViewController <UIWebViewDelegate, UIScrollViewDelegate>{ } @property (weak, nonatomic) IBOutlet UIWebView *webView; @property(copy) NSArray *menuItems; @property (weak, nonatomic)

How to fit PDF height in UIWebView in iPhone/iPad

与世无争的帅哥 提交于 2019-12-02 01:39:51
问题 I have a project that uses a UIWebView to display a single page PDF file. I would like this content to fit by height (vertically). The default is only to fit width (horizontally). Is there any way to overcome this? 回答1: I ran against the same problem and couldn't find a way to do it with UIWebView. If you only want to display a single PDF-page, you can pretty much take the code from Apple's ZoomingPDFViewer Example. I took the two classes PDFScrollView and TiledPDFView and with a little

Disable hyperlinks in UIWebView

ⅰ亾dé卋堺 提交于 2019-12-02 01:39:35
I want to disable hyperlinks in UIWebVIew after the initial page loaded without disabling the scrolling feature. That is, I should have user interaction enabled. You can work with webView shouldStartLoadWithRequest like this: (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType; { NSURL *loadURL = [[request URL]retain]; //change next line to whatever condition you need, e.g. //[[loadURL relativeString] ....] contains a certain substring //or starts with certain letter or ... if([[loadURL scheme]

Question about UIWebview and Universal Application

人走茶凉 提交于 2019-12-02 01:30:11
I have an Universal Application and my question is, if it is possible to load two different html files in my UIWebview depending on the iDevice. Thanks for any answers. iAmitWagh you can use this... if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)//if device is ipad { } else //if device is iPhone { } Nanjunda You can use UIDevice class. UIDevice *device = [UIDevice currentDevice]; if ([device.model isEqualToString:@"iPad"]) { } else { } 来源: https://stackoverflow.com/questions/6290782/question-about-uiwebview-and-universal-application

How to see ping pong in web socket in iOS

假装没事ソ 提交于 2019-12-02 01:15:16
问题 I am doing websocket between webview in iOS and Socketserver. But I am unable to watch ping-pong that happens because javascript does not have any call back methods for it. 回答1: Use Charles Proxy It has a tab called WebSocket that shows all web socket related conversations including frames such as Ping , Pong and Close . 来源: https://stackoverflow.com/questions/39914968/how-to-see-ping-pong-in-web-socket-in-ios

How to refer a local image file from UIWebView's HTML on iPhone?

拥有回忆 提交于 2019-12-02 01:05:14
I would like to use <img src=" temp.jpg " /> in my UIWebView's HTML. How can I refer to a local file named temp.jpg to save precious loading time? Of course the obvious choice would be <img src=" .\temp.jpg " /> but I have no idea where my root is... NSURL *url=[[NSBundle mainBundle] bundleURL]; [webView loadHTMLString:string baseURL:url]; This let's the root be the app's main bundle. This will create a URL object that contains the location of your file on disk. You can then use this to output a valid file:// URL string that can be used within img tags. NSURL* fileURL = [[NSBundle mainBundle]