Question

I need to transport every view in my layout somewhere else in that layout... So i need something to put every view in it, and move only it... How can i manage this? (It may be too easy, sorry if it is, but i'm pretty new on android. I've heard something like "holder" but i'm not so sure if it can be move with

setMarginLeft(...) 

Thanks in advance for helps!

Put every view in one another RelativeLayout, but now i cannot see the views?

xml file:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/menu"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#FFFFFF"
android:orientation="vertical" >


<RelativeLayout
    android:id="@+id/leftLayout"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentLeft="true"
    android:layout_alignParentRight="true"
    android:layout_alignParentTop="true"
    android:layout_marginLeft="70dp"
    android:orientation="vertical" >


    <TextView
        android:id="@+id/leftMenu"
        android:enabled="true"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Left Menu"
        android:layout_alignParentTop="true"
        android:layout_marginTop="20dp"
        android:textAppearance="?android:attr/textAppearanceMedium"
        android:textColor="#000000" />

    <ListView
        android:id="@+id/list"
        android:enabled="true"
        android:layout_width="match_parent"
        android:layout_height="344dp"
        android:layout_alignParentTop="true"
        android:layout_marginTop="70dp" >

    </ListView>


</RelativeLayout>

</RelativeLayout>
Was it helpful?

Solution

You just need a single a parent view, take a linearlayout or other layout:

and set margin to that layout.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top