2017-12-27 209 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组件下。在这里,每一次我更换片段,但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> 
相关问题