Skip to main content

how to add some space in uiwebview [closed]



Now I have an uiwebview ,but I need some space right and left of the text.and I just write code programmatically,don't use IB.







m_webView = [[UIWebView alloc] initWithFrame:CGRectMake(11, 95, 298, 350)];

NSString * path = [[NSBundle mainBundle] bundlePath];

NSURL * baseURL = [NSURL fileURLWithPath:path];



NSString * htmlString = [NSString stringWithFormat:defString, NSLocalizedString(@"kTerms_and_Legal_content_text", nil)];



[m_webView loadHTMLString:htmlString baseURL:baseURL];




Comments

  1. You can add &nbsp programatically around your string. Which will give the space you wanted.Try the following snippet,

    [NSString stringWithFormat:%@%@%@,@" ", @"YourString",@" "];

    ReplyDelete

Post a Comment

Popular posts from this blog

Slow Android emulator

I have a 2.67 GHz Celeron processor, 1.21 GB of RAM on a x86 Windows XP Professional machine. My understanding is that the Android emulator should start fairly quickly on such a machine, but for me it does not. I have followed all instructions in setting up the IDE, SDKs, JDKs and such and have had some success in staring the emulator quickly but is very particulary. How can I, if possible, fix this problem?