<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>devedup.com &#187; Interface Builder</title>
	<atom:link href="http://blog.devedup.com/index.php/category/interface-builder/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.devedup.com</link>
	<description></description>
	<lastBuildDate>Sun, 09 Oct 2011 16:00:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>iPhone: UITextView with rounded edges (to look like a UITextField)</title>
		<link>http://blog.devedup.com/index.php/2010/06/06/iphone-uitextview-with-rounded-edges-to-look-like-a-uitextfield/</link>
		<comments>http://blog.devedup.com/index.php/2010/06/06/iphone-uitextview-with-rounded-edges-to-look-like-a-uitextfield/#comments</comments>
		<pubDate>Sun, 06 Jun 2010 19:31:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Interface Builder]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[rounded uitextview]]></category>
		<category><![CDATA[uitextfield]]></category>
		<category><![CDATA[uitextview]]></category>
		<category><![CDATA[uitextview border]]></category>

		<guid isPermaLink="false">http://blog.devedup.com/?p=226</guid>
		<description><![CDATA[UITextView has square edges, and looks ugly compared to a UITextField! Unfortunately, there isn&#8217;t an option to give the UITextView a nice border. There are various ways to do this, such as creating your own background image for the UITextView, but I have found a relatively easy way to do it &#8211; and one that [...]]]></description>
			<content:encoded><![CDATA[<p>UITextView has square edges, and looks ugly compared to a UITextField!</p>
<p><img src="http://blog.devedup.com/wp-content/uploads/2010/06/Screen-shot-2010-06-06-at-20.22.29-161x300.png" alt="Screen shot 2010-06-06 at 20.22.29" title="Screen shot 2010-06-06 at 20.22.29" width="161" height="300" class="aligncenter size-medium wp-image-231" /></p>
<p>Unfortunately, there isn&#8217;t an option to give the UITextView a nice border. There are various ways to do this, such as creating your own background image for the UITextView, but I have found a relatively easy way to do it &#8211; and one that anyone without photoshop skills can achieve. </p>
<p>I achieve it by placing a UITextField behind the UITextView. However, in InterfaceBuilder you can&#8217;t change the height of a UITextField, so you have to edit the .xib file in Text Edit to change its height.</p>
<p>Here are the steps you need to do:<br />
<b></p>
<ol>
<li>Add a UITextField to your View and put a UITextView on top of it. </li>
<li>Decide on how high you want your UITextView and resize it.</li>
<li>Give the UITextField a tag of 999 (or whatever you want) (hit CMD-1 to bring up the attributes inspector to do this).</li>
<li>Save the .xib file and then right click the file > Open With > Other > TextEdit</li>
<li>Search for your tag, 999, and in the same <object> section of the xml you will see something like: <string key="NSFrame">{{25, 199}, {275, 31}}</string> (see below)</li>
<li>You need to change 31 to the same height as your UITextView and then save the .xib file in TextEdit</li>
<li>When you return to IB it will tell you the document has been modified, click Revert</li>
<li>You should now see a tall UITextField behind your UITextView. Make sure your UITextView has a transparent background!</li>
</ol>
<p></b></p>
<pre class="brush: xml;">
&lt;object class=&quot;IBUITextField&quot; id=&quot;154341485&quot;&gt;
	&lt;reference key=&quot;NSNextResponder&quot; ref=&quot;774585933&quot;/&gt;
	&lt;int key=&quot;NSvFlags&quot;&gt;292&lt;/int&gt;
	&lt;string key=&quot;NSFrame&quot;&gt;{{25, 199}, {275, 31}}&lt;/string&gt; THIS IS THE LINE THAT YOU NEED TO EDIT.... CHANGE 31 TO THE HEIGHT OF YOUR UITEXTVIEW
	&lt;reference key=&quot;NSSuperview&quot; ref=&quot;774585933&quot;/&gt;
	&lt;reference key=&quot;IBUIBackgroundColor&quot; ref=&quot;157267157&quot;/&gt;
	&lt;bool key=&quot;IBUIOpaque&quot;&gt;NO&lt;/bool&gt;
	&lt;bool key=&quot;IBUIClearsContextBeforeDrawing&quot;&gt;NO&lt;/bool&gt;
	&lt;int key=&quot;IBUITag&quot;&gt;999&lt;/int&gt;THIS IS THE TAG YOU CHOSE TO HELP YOU FIND THIS SECTION IN THE XIB FILE
</pre>
<p>Here is my project if you need help seeing how I did it.</p>
<p><a href="http://blog.devedup.com/wp-content/uploads/2010/06/RoundedUITextView.zip"><img src="http://blog.devedup.com/wp-content/uploads/2010/03/xcodeProject.png" alt="xcodeProject" title="xcodeProject" width="70" height="59" class="aligncenter size-full wp-image-218" /></a></p>
<p>Thanks</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.devedup.com/index.php/2010/06/06/iphone-uitextview-with-rounded-edges-to-look-like-a-uitextfield/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

