uiwebview

Hiding keyboard iphone sdk?

Deadly 提交于 2019-12-12 05:13:21
问题 I have a UISearchBar . I want the the keyboard to go away as soon as user hits search...i did try resignFirstResponder but that didn't work. any help would be appreciated - (void)viewDidLoad { [super viewDidLoad]; self.title = NSLocalizedString(@"Songs", @"Search for songs"); NSMutableArray *array = [[NSArray alloc]initWithObjects: @"Book_1", @"Book 2", @"Book _ 4", nil]; self.booksArray = array; [array release]; search.delegate=self; // Uncomment the following line to display an Edit button

UIWebView change line spacing text

半世苍凉 提交于 2019-12-12 05:05:40
问题 I'm looking for a javascript method or a way to change line spacing of text in a UIWebView. Any ideas? Edit: Evan has answered the above question, but I have another on the same topic. How can I query the source for the current line spacing value? 回答1: You will need to inject javascript into the UIWebView 's source by calling stringByEvaluatingJavaScriptFromString: . Javascript: var head = document.getElementsByTagName('head')[0], style = document.createElement('style'), rules = document

How can I create a table view cell that changes its height dynamically to fit its content?

落花浮王杯 提交于 2019-12-12 05:02:10
问题 I'm displaying some markdown that the user wrote in a table view. The way I display these markdown texts is to convert the markdown to HTML and then display the HTML on a UIWebview . Because, well, I can use some cool CSS. After some research, I found that I can set estimatedRowHeight to some stuff and set rowHeight to UITableViewAutomaticDimension . I also found out how to set a UIWebView 's frame so that it fits its content here: So I wrote this code: var results: [Entry] = [] override func

How to display Admob on UIWebView Application?

末鹿安然 提交于 2019-12-12 04:59:15
问题 I have previously tried displaying Admobs ads on TabbarView based application. But when I try to implement the same on a UIWebView based application things don't seem to work right. I tried to add the code inside -(void)viewDidLoad but the application crashed. The methods i'm using inside my application include: (void) viewDidAppear:(BOOL)animated (void) viewDidDisappear:(BOOL)animated (void) loading Where should I implement it to view in my application? Any help would be appreciated. 回答1:

Implementing UIWebView inside UIScrollView

◇◆丶佛笑我妖孽 提交于 2019-12-12 04:56:43
问题 I'm trying to use UIWebView inside UIScrollView, I want to display an webview under an image and make them scrollable. So I flowed those step : Desactivate the Scroll Property for UIWebView Set the UIScrollView and UIWebView height equals to content size. And this my code : - (void)viewDidLoad { [super viewDidLoad]; self.contentReader.scrollView.scrollEnabled = NO; NSString *myDescriptionHTML = [NSString stringWithFormat:@"<html> \n" "<head> \n" "<style type=\"text/css\"> \n" "body {font

Static cells in UITableViewController opening different URL on the same nib

浪子不回头ぞ 提交于 2019-12-12 04:55:38
问题 I am quite new to UITableViewController, I would like to make a static cells UITableViewController and each static cells open up the same nib file but the URL of the UIWebView will be different. e.g. row 1 will open google.com and row 2 in yahoo.com. May I know how can i do that? Thanks 回答1: You'll want to implement the tableview delegate method, tableView:didSelectRowAtIndexPath: , this will allow you to ask the tableview which cell was selected and then take the appropriate action. An

IOS View still does not load in the correct position

懵懂的女人 提交于 2019-12-12 04:53:56
问题 I thought I had this cleared up but apparently not. I am using the code below to set a webview to appear between the top nag bar and tab bar at the bottom. This happens in my viewDidLoad() method. It was working fine on all simulators I had tested it on, however when I tested a friend's iPhone 4s running 7.1.1 the webview rendered spanning the entire height of the screen, covered by both the top nag bar and bottom tab bar. How to I get the desired behavior across all devices and OS above 7?

How can i display more than one file with different file extension in UIWebView/UIScrollView?

梦想的初衷 提交于 2019-12-12 04:53:04
问题 I did google too much to find it but not find what i exactly want. I have file.png, file1.jpg, file2.pdf, file.txt and file.doc and i want to preview this all file in one UIWebView or UIScrollView . Please help me how can i do it? Thanks in advance. 回答1: For Example image showing through HTML sting , This image in bundle file . The HTML sting load in webview follow this ! as like you need creating html sting with all files and display NSString *imageFileName = @"images"; NSString

Press a Button and open a URL in another ViewController

旧时模样 提交于 2019-12-12 04:45:43
问题 I am trying to learn Xcode by making a simple app. But I been looking on the net for hours (days) and I cant figure it out how I make a button that open a UIWebView in another ViewController :S first let me show you some code that I have ready: I have a few Buttons om my main Storyboard that each are title some country codes like UK, CA and DK. When I press one of those Buttons I have an IBAction like this: - (IBAction)ButtonPressed:(UIButton *)sender { // Google button pressed NSURL* allURLS

how to disable horizontal scroll for a uiwebview?

…衆ロ難τιáo~ 提交于 2019-12-12 04:06:25
问题 I created a sample in which i imported a word(.docx)on to the uiwebview and displayed.I got the output but i don't want to display the horizontal scroll bar and the vertical scroll also working not properly i can see the black space behind the webview when i scroll it vertically. Here is my code: #import <UIKit/UIKit.h> @interface userguideLinesNewViewController : UIViewController { IBOutlet UIWebView *webView; } @property (nonatomic,retain) UIWebView *webView; -(void)loadDocument:(NSString*