2015-10-02 2 views
0

Я хочу добавить кнопку чуть ниже gridview. Он просто не уверен, стр. этот framelayout находится внутри другого frameelayout (базового контейнера). Я попытался установить heigh = 0dp и weight = 1, но не повезло. пожалуйста, помогите :) ТНХAndroid: Не удается добавить кнопку ниже Gridview

Вот мой код,

<?xml version="1.0" encoding="utf-8"?> 
<FrameLayout 
xmlns:android="http://schemas.android.com/apk/res/android" 
android:id="@+id/baseContainer" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
xmlns:ads="http://schemas.android.com/apk/res-auto"> 

<LinearLayout 
    android:orientation="vertical" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent"> 

    <android.support.v4.widget.SwipeRefreshLayout 
     xmlns:android="http://schemas.android.com/apk/res/android" 
     android:id="@+id/fragment_recent_swipeRefreshLayout" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content"> 

    <GridView xmlns:android="http://schemas.android.com/apk/res/android" 
     android:id="@+id/fragment_recent_gridview" 
     android:numColumns="auto_fit" 
     android:gravity="center" 
     android:stretchMode="columnWidth" 
     android:layout_width="match_parent" 
     android:layout_height="0dp" 
     android:layout_weight="1" 
     android:listSelector="#00000000" 
     /> 

</android.support.v4.widget.SwipeRefreshLayout> 
    <Button 
     android:id="@+id/recent_filterBtn" 
     android:layout_width="match_parent" 
     android:layout_height="34dp" 
     android:text="my button" 
     android:textColor="@drawable/button_text_color2" 
     android:textSize="12dp" 
     android:textStyle="bold" /> 
</LinearLayout> 
</FrameLayout> 

ответ

0

Put:

<android.support.v4.widget.SwipeRefreshLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/fragment_recent_swipeRefreshLayout" 
    android:weight = "1" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content"> 

И удалить вес тег из GridView

+0

вы решили мою проблему мгновенно .. ТНХ много – Ivanapp