Pregunta

Hi have a app with a actionbar sherlock and a listview that shows 1 imageview and 2 textviews, but the actionbar blocks the first row in listview. (See image here)enter image description here

This is the code

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/settings"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="vertical" >
            <ListView
            android:id="@+id/android:list"
            android:layout_width="wrap_content"
            android:layout_height="538dp"/>         
</LinearLayout>

and the row.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >
    <LinearLayout
        android:id="@+id/linearLayout2"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_weight="0.17"
        android:orientation="vertical" >
        <RelativeLayout
            android:id="@+id/relativeLayout1"
            android:layout_width="match_parent"
            android:layout_height="wrap_content" >
            <LinearLayout
                android:id="@+id/linearLayout3"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentLeft="true"
                android:layout_centerVertical="true" >
                <ImageView
                    android:id="@+id/iNavigation"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:paddingLeft="10px"
                    android:paddingTop="10px"
                    android:src="@drawable/llevame" />
            </LinearLayout>
            <LinearLayout
                android:id="@+id/linearLayout4"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentRight="true"
                android:layout_centerVertical="true"
                android:layout_toRightOf="@+id/linearLayout3"
                android:orientation="vertical" >
                <TextView
                    android:id="@+id/nombreTienda"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:paddingLeft="12px"
                    android:text="Large Text"
                    android:textAppearance="?android:attr/textAppearanceLarge" />
            </LinearLayout>
        </RelativeLayout>
        <TextView
            android:id="@+id/dirTienda"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:paddingLeft="10px"
            android:paddingTop="30px"
            android:text="TextView"
            android:textSize="15px" />
    </LinearLayout>
</LinearLayout>

I have other activity same of this and dont happen this..Why?

¿Fue útil?

Solución

It appears as though the action bar is overlapping your gallery. Try adding:

android:layout_marginTop="?android:attr/actionBarSize"

To your "settings" LinearLayout. Without seeing your other Activity's XML, it's difficult to say why it's not happening there.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top