0

My app has a feature Pinterest sharing for this purpose I have followed This answer it is working good but when i am sharing the UIWebView contents are looking nonaligned. attached is the sample screenshot

enter image description here

But I have gone through shop style app which has aligned contents in UIWebView attached is sample image

enter image description here

How can I get the UIWebView contents like shop style app? Please guide me

Community
  • 1
  • 1
thavasidurai
  • 1,972
  • 1
  • 26
  • 51

2 Answers2

0

Try disabling autolayout feature and set your own constraints for the UI items. For more reference Check on the this link. I followed the same tutorial for my app and it worked.

bachman
  • 690
  • 7
  • 22
  • Thanks for your, I don't think this should be the answer for this. Because I suppose to adjust the layout of UIWebView's body content – thavasidurai Nov 20 '13 at 05:50
0

After reading the related answer, I think the problem might come from the hard coded HTML code you generate in -(NSString*)generatePinterestHTML function. According to your screenshots, your sharing form is staying next to your image, while it should go to a new paragraph. Though in the related answer's code, @Sudha is putting <p> tags for line breaks, whether you've omitted them, or you've just forgotten them.

In the first case, you should insert a <br /> tag at the beginning of the third [htmlString appendFormat]; instruction.

Which means you should end up with this snippet:

...

[htmlString appendFormat:@"<html> <body>"];
[htmlString appendFormat:@"<p align=\"center\"><a href=%@ class=\"pin-it-button\" count-layout=\"horizontal\"><img border=\"0\" src=\"http://assets.pinterest.com/images/PinExt.png\" title=\"Pin It\" /></a></p>", buttonUrl];
[htmlString appendFormat:@"<br/><p align=\"center\"><img width=\"400px\" height = \"400px\" src=%@></img></p>", imageUrl];
[htmlString appendFormat:@"<script type=\"text/javascript\" src=\"//assets.pinterest.com/js/pinit.js\"></script>"];
[htmlString appendFormat:@"</body> </html>"];
...

Note : If this answer didn't help you, you should post the code you used, so that we can directly see what's wrong

mrcendre
  • 1,053
  • 2
  • 15
  • 28