2017-12-27 5 views
0
<?xml version="1.0" encoding="utf-8"?> 
     <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
      xmlns:app="http://schemas.android.com/apk/res-auto" 
      xmlns:tools="http://schemas.android.com/tools" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      app:layout_behavior="@string/appbar_scrolling_view_behavior" 
      tools:context="com.example.nimeshbhalani.webservice.MainActivity" 
      tools:showIn="@layout/app_bar_main" 
      android:orientation="vertical"> 
      <GridView xmlns:android="http://schemas.android.com/apk/res/android" 
       android:id="@+id/gridview" 
       android:layout_width="match_parent" 
       android:layout_height="wrap_content" 
       android:columnWidth="200dp" 
       android:gravity="center" 
       android:verticalSpacing="0dp" 
       android:horizontalSpacing="0dp" 
       android:numColumns="2" 
       android:stretchMode="columnWidth" /> 
      <FrameLayout 
       android:layout_width="match_parent" 
       android:layout_height="match_parent" 
       android:id="@+id/fragmnt"/> 
     </RelativeLayout> 
<?xml version="1.0" encoding="utf-8"?> 

主な活動は、今、私はどのようにすることができます。このフラグメント を交換したいグリッドのアイテムを持っています私はグリッドアイテムはフラグメントUIコンポーネントの下にありますか?はここで、iはフラグメントを交換していますが、GridViewのはいつも私のフラグメントの後ろの項目が含まれているたびに任意のロジックがあるUI.Ifので、私は前のビューを削除することができます

+0

本当に達成したいことを説明する必要があります。ここでは不明です。理解できる意図で編集投稿を投稿しようとしてください。たぶん絵が人々の理解を助けるかもしれない。 –

答えて

0

フラグメントandroid:background="#FFFFFF"のルートレイアウトに背景色を追加することで、これを克服できます。

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


</LinearLayout> 
関連する問題