<?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>Code Library &#187; relativelayout</title>
	<atom:link href="http://www.ucosoft.com/tag/relativelayout/feed" rel="self" type="application/rss+xml" />
	<link>http://www.ucosoft.com</link>
	<description>Free Source Code and Program Tips</description>
	<lastBuildDate>Thu, 22 Jul 2010 05:17:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Eclipse developed Android, RelativeLayout (study 3)</title>
		<link>http://www.ucosoft.com/eclipse-developed-android-relativelayout-study-2.html</link>
		<comments>http://www.ucosoft.com/eclipse-developed-android-relativelayout-study-2.html#comments</comments>
		<pubDate>Fri, 18 Dec 2009 10:15:06 +0000</pubDate>
		<dc:creator>support</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[developed]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[relativelayout]]></category>
		<category><![CDATA[study]]></category>

		<guid isPermaLink="false">http://www.ucosoft.com/uncategorized/eclipse-developed-android-relativelayout-study-2.html</guid>
		<description><![CDATA[Hello, RelativeLayout A RelativeLayout is a ViewGroup that allows you to layout child elements in positions relative to the parent or siblings elements. Start a new project / Activity called HelloRelativeLayout. Open the layout file. Make it like so: 1 &#38;lt;? xml version = &#38;quot;1.0&#38;quot; encoding = &#38;quot;utf-8&#38;quot;?&#38;gt; &#38;lt;RelativeLayout xmlns: android = &#38;quot;http://schemas.android.com/apk/res/android&#38;quot; android: layout_width [...]]]></description>
			<content:encoded><![CDATA[<h1>  Hello, RelativeLayout </h1>
<div>
<p class=jd-descr> A <code>RelativeLayout</code> is a ViewGroup that allows you to layout child elements in positions relative to the parent or siblings elements. </p>
<div class=jd-descr>
<ol>
<li>  Start a new project / Activity called HelloRelativeLayout. </li>
<li>  Open the layout file. Make it like so:

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="java" style="font-family:monospace;">  <span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;?</span> xml version <span style="color: #339933;">=</span> <span style="color: #339933;">&amp;</span>quot<span style="color: #339933;">;</span><span style="color: #cc66cc;">1.0</span><span style="color: #339933;">&amp;</span>quot<span style="color: #339933;">;</span> encoding <span style="color: #339933;">=</span> <span style="color: #339933;">&amp;</span>quot<span style="color: #339933;">;</span>utf<span style="color: #339933;">-</span><span style="color: #cc66cc;">8</span><span style="color: #339933;">&amp;</span>quot<span style="color: #339933;">;?&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;</span>RelativeLayout xmlns<span style="color: #339933;">:</span> android <span style="color: #339933;">=</span> <span style="color: #339933;">&amp;</span>quot<span style="color: #339933;">;</span>http<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">//schemas.android.com/apk/res/android&amp;quot; android: layout_width = &amp;quot;fill_parent&amp;quot; android: layout_height = &amp;quot;fill_parent&amp;quot;&amp;gt; &amp;lt;TextView android:id=&amp;quot;@+id/label&amp;quot; android:layout_width=&amp;quot;fill_parent&amp;quot; android:layout_height=&amp;quot;wrap_content&amp;quot; android:text=&amp;quot;Type here:&amp;quot;/&amp;gt; &amp;lt;EditText android: id = &amp;quot; @ + id / entry &amp;quot;android: layout_width =&amp;quot; fill_parent &amp;quot;android: layout_height =&amp;quot; wrap_content &amp;quot;android: background =&amp;quot; @ android: drawable / editbox_background &amp;quot;android: layout_below =&amp;quot; @ id / label &amp;quot;/&amp;gt; &amp;lt;Button android: id = &amp;quot;@ + id / ok&amp;quot; android: layout_width = &amp;quot;wrap_content&amp;quot; android: layout_height = &amp;quot;wrap_content&amp;quot; android: layout_below = &amp;quot;@ id / entry&amp;quot; android: layout_alignParentRight = &amp;quot;true&amp;quot; android: layout_marginLeft = &amp;quot;10dip&amp;quot; android: text = &amp;quot; OK &amp;quot;/&amp;gt; &amp;lt;Button android:layout_width=&amp;quot;wrap_content&amp;quot; android:layout_height=&amp;quot;wrap_content&amp;quot; android:layout_toLeftOf=&amp;quot;@id/ok&amp;quot; android:layout_alignTop=&amp;quot;@id/ok&amp;quot; android:text=&amp;quot;Cancel&amp;quot; /&amp;gt; &amp;lt; / RelativeLayout&amp;gt;</span></pre></td></tr></table></div>

<p>  Pay attention to each of the additional <code>layout_*</code> attributes (besides the usual width and height, which are required for all elements). When using relative layout, we use attributes like <code>layout_below</code> and <code>layout_toLeftOf</code> to describe How we&#39;d like to position each View. Naturally, these are different relative positions, and the value of the attribute is the id of the element we want the position relative to. </p>
</li>
<li>  Make sure your Activity loads this layout in the <code>onCreate()</code> method:
</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="java" style="font-family:monospace;">  <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> onCreate <span style="color: #009900;">&#40;</span>Bundle savedInstanceState<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">onCreate</span> <span style="color: #009900;">&#40;</span>savedInstanceState<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> setContentView <span style="color: #009900;">&#40;</span>R.<span style="color: #006633;">layout</span>.<span style="color: #006633;">main</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#41;</span></pre></td></tr></table></div>

<p>  <code>R.layout.main</code> refers to the <code>main.xml</code> layout file. </p>
</li>
<li>  Run it. </li>
</ol>
</div>
</div>

	Tags: <strong><a href="http://www.ucosoft.com/tag/android" title="android" rel="tag">android</a>, <a href="http://www.ucosoft.com/tag/developed" title="developed" rel="tag">developed</a>, <a href="http://www.ucosoft.com/tag/eclipse" title="eclipse" rel="tag">eclipse</a>, <a href="http://www.ucosoft.com/tag/relativelayout" title="relativelayout" rel="tag">relativelayout</a>, <a href="http://www.ucosoft.com/tag/study" title="study" rel="tag">study</a></strong><br />
]]></content:encoded>
			<wfw:commentRss>http://www.ucosoft.com/eclipse-developed-android-relativelayout-study-2.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eclipse developed Android, RelativeLayout (study 3)</title>
		<link>http://www.ucosoft.com/eclipse-developed-android-relativelayout-study.html</link>
		<comments>http://www.ucosoft.com/eclipse-developed-android-relativelayout-study.html#comments</comments>
		<pubDate>Wed, 02 Dec 2009 02:22:56 +0000</pubDate>
		<dc:creator>support</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[developed]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[relativelayout]]></category>
		<category><![CDATA[study]]></category>

		<guid isPermaLink="false">http://www.ucosoft.com/uncategorized/eclipse-developed-android-relativelayout-study.html</guid>
		<description><![CDATA[Hello, RelativeLayout A RelativeLayout is a ViewGroup that allows you to layout child elements in positions relative to the parent or siblings elements. Start a new project / Activity called HelloRelativeLayout. Open the layout file. Make it like so: 1.0 &#38; quot ; encoding = &#38; quot ; utf - 8 &#38; quot ;?&#38; gt [...]]]></description>
			<content:encoded><![CDATA[<h1>  Hello, RelativeLayout </h1>
<div>
<p class="jd-descr">  A <code>RelativeLayout</code> is a ViewGroup that allows you to layout child elements in positions relative to the parent or siblings elements. </p>
<div class="jd-descr">
<ol>
<li>  Start a new project / Activity called HelloRelativeLayout. </li>
<li>  Open the layout file. Make it like so:
<div class="wp_syntax">
<div class="code">
<pre style="font-family:monospace">  1.0 &amp; quot ; encoding = &amp; quot ; utf - 8 &amp; quot ;?&amp; gt ; &amp; lt ; RelativeLayout xmlns : android = &amp; quot ; http : //schemas.android.com/apk/res/android&amp;quot; android: layout_width = &amp;quot;fill_parent&amp;quot; android: layout_height = &amp;quot;fill_parent&amp;quot;&amp;gt; &amp;lt;TextView android:id=&amp;quot;@+id/label&amp;quot; android:layout_width=&amp;quot;fill_parent&amp;quot; android:layout_height=&amp;quot;wrap_content&amp;quot; android:text=&amp;quot;Type here:&amp;quot;/&amp;gt; &amp;lt;EditText android: id = &amp;quot; @ + id / entry &amp;quot;android: layout_width =&amp;quot; fill_parent &amp;quot;android: layout_height =&amp;quot; wrap_content &amp;quot;android: background =&amp;quot; @ android: drawable / editbox_background &amp;quot;android: layout_below =&amp;quot; @ id / label &amp;quot;/&amp;gt; &amp;lt;Button android: id = &amp;quot;@ + id / ok&amp;quot; android: layout_width = &amp;quot;wrap_content&amp;quot; android: layout_height = &amp;quot;wrap_content&amp;quot; android: layout_below = &amp;quot;@ id / entry&amp;quot; android: layout_alignParentRight = &amp;quot;true&amp;quot; android: layout_marginLeft = &amp;quot;10dip&amp;quot; android: text = &amp;quot; OK &amp;quot;/&amp;gt; &amp;lt;Button android:layout_width=&amp;quot;wrap_content&amp;quot; android:layout_height=&amp;quot;wrap_content&amp;quot; android:layout_toLeftOf=&amp;quot;@id/ok&amp;quot; android:layout_alignTop=&amp;quot;@id/ok&amp;quot; android:text=&amp;quot;Cancel&amp;quot; /&amp;gt; &amp;lt; / RelativeLayout&amp;gt; &amp; Lt;? Xml version = &amp; quot; 1.0 &amp; quot; encoding = &amp; quot; utf - 8 &amp; quot;? &amp; Gt; &amp; lt; RelativeLayout xmlns: android = &amp; quot; http: / / schemas.android.com / apk / res / android &quot;android: layout_width =&quot; fill_parent &quot;android: layout_height =&quot; fill_parent &quot;&gt; &lt;TextView android: id =&quot; @ + id / label &quot;android: layout_width =&quot; fill_parent &quot;android: layout_height = &quot;wrap_content&quot; android: text = &quot;Type here:&quot; /&gt; &lt;EditText android: id = &quot;@ + id / entry&quot; android: layout_width = &quot;fill_parent&quot; android: layout_height = &quot; wrap_content &quot;android: background =&quot; @ android: drawable / editbox_background &quot;android: layout_below =&quot; @ id / label &quot;/&gt; &lt;Button android: id =&quot; @ + id / ok &quot;android: layout_width = &quot;wrap_content&quot; android: layout_height = &quot;wrap_content&quot; android: layout_below = &quot;@ id / entry&quot; android: layout_alignParentRight = &quot;true&quot; android: layout_marginLeft = &quot;10dip&quot; android: text = &quot;OK&quot; / &gt; &lt;Button android: layout_width = &quot;wrap_content&quot; android: layout_height = &quot;wrap_content&quot; android: layout_toLeftOf = &quot;@ id / ok&quot; android: layout_alignTop = &quot;@ id / ok&quot; android: text = &quot;Cancel&quot; ; /&gt; &lt;/ RelativeLayout&gt; </pre>
</div>
</div>
<p>  Pay attention to each of the additional <code>layout_*</code> attributes (besides the usual width and height, which are required for all elements). When using relative layout, we use attributes like <code>layout_below</code> and <code>layout_toLeftOf</code> to describe How we&#39;d like to position each View. Naturally, these are different relative positions, and the value of the attribute is the id of the element we want the position relative to. </p>
</li>
<li>  Make sure your Activity loads this layout in the <code>onCreate()</code> method: </p>
<div class="wp_syntax">
<div class="code">
<pre style="font-family:monospace">  onCreate ( Bundle savedInstanceState ) ( super . onCreate ( savedInstanceState ) ; setContentView ( R. layout . main ) ; ) public void onCreate (Bundle savedInstanceState) (super. onCreate (savedInstanceState); setContentView (R. layout. main);) </pre>
</div>
</div>
<p>  <code>R.layout.main</code> refers to the <code>main.xml</code> layout file. </p>
</li>
<li>  Run it. </li>
</ol>
</div>
</div>

	Tags: <strong><a href="http://www.ucosoft.com/tag/android" title="android" rel="tag">android</a>, <a href="http://www.ucosoft.com/tag/developed" title="developed" rel="tag">developed</a>, <a href="http://www.ucosoft.com/tag/eclipse" title="eclipse" rel="tag">eclipse</a>, <a href="http://www.ucosoft.com/tag/relativelayout" title="relativelayout" rel="tag">relativelayout</a>, <a href="http://www.ucosoft.com/tag/study" title="study" rel="tag">study</a></strong><br />
]]></content:encoded>
			<wfw:commentRss>http://www.ucosoft.com/eclipse-developed-android-relativelayout-study.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

