Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

14 lines (13 sloc) 1.673 kb
<h3>Text Boxes</h3>
<p>Block-Level tags (like P or DIV) can have a padding and background color.</p>
<p>Note: Only one level of boxing is properly supported. This is a crude workaround as CoreText does not support NSTextBlock on iOS.</p>
<pre>&lt;p style="background-color:yellow;padding:20px;"&gt;...&lt;/p&gt;</pre>
<p>By default the background is rectangle drawn for the entire width of the content view. There is a delegate method which you can override to do your own drawing. For example a stretchable UIImage. Or a rounded rectangle as shown here.</p>
<p style="background-color:yellow;padding: 20px;">
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</p>
<h3>Some test cases</h3>
<p style="background-color:#aabbcc;padding:10 10 10 10;">Before the list with 10px padding</p>
<ul style="background-color:#cc2233;padding:30 30 30 30;">
<li style="line-height:50px;">These items</li><li style="line-height:50px;">have a fixed line height of 50px</li><li style="line-height:50px;">Note: The line-height becomes the ascender. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</li></ul>
<p style="background-color:#aabbcc;padding:25 25 25 25;font-size:50px">After the list with 25 px padding</p>
Jump to Line
Something went wrong with that request. Please try again.