zoukankan      html  css  js  c++  java
  • 解决fragmentTransaction.replace不能全屏

    今天遇到个问题,使用fragmentTransaction.replace替换后的内容不能全屏。。

    FragmentManager fragmentManager = getSupportFragmentManager();
      FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
    
      Fragment playFragment = new ColumnFragment();
      fragmentTransaction.replace(R.id.fragment_play, playFragment);
      fragmentTransaction.commit();
    


     

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:background="#f00"
        >
    
    
        <LinearLayout
            android:background="#ccc"
            android:orientation="vertical"
            android:id="@+id/<strong>fragment_play</strong>"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent">
        </LinearLayout>
    
    </LinearLayout>
    
    从网上查找了相关的资料。农民伯伯的。

    可是不能解决。

    http://www.cnblogs.com/over140/archive/2012/07/11/2586620.html

    把要替换的内容使用FrameLayout后问题解决。

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:background="#f00"
        >
    
    
        <FrameLayout
            android:background="#ccc"
            android:orientation="vertical"
            android:id="@+id/fragment_play"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent">
        </FrameLayout>
    
    </LinearLayout>
    


      

    but。。。

    why????

  • 相关阅读:
    [转]老男孩读pcie
    nand
    面试题目汇总
    redis的tcp-backlog配置
    Redis 3.0.4 sentinels
    Redis 3.0.4 客户端
    Redis 3.0.4 事件驱动
    Redis 3.0.4 AOF持久化
    Redis 3.0.4 数据库
    Redis 3.0.4 RDB持久化
  • 原文地址:https://www.cnblogs.com/clnchanpin/p/6888750.html
Copyright © 2011-2022 走看看