这个问题是突然出现了,之前一直没有.
下面贴出添加fragment的代码.
FragmentActivity activity = getActivity();
if (activity != null) {
FragmentManager fragmentManager = activity.getSupportFragmentManager();
FragmentTransaction transaction = fragmentManager.beginTransaction();
fragment.setArguments(args);
if (aminEnable) {
transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
}
transaction.add(layoutId, fragment, tag);
transaction.addToBackStack(stackName);
transaction.commitAllowingStateLoss();
fragmentManager.executePendingTransactions();
}如果把linerlayout换成Relatevlayout就不会出现无法充满全屏的问题.linerlayout开头如下:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bg_main"
android:clickable="true"
android:orientation="vertical" >
下面贴出添加fragment的代码.
FragmentActivity activity = getActivity();
if (activity != null) {
FragmentManager fragmentManager = activity.getSupportFragmentManager();
FragmentTransaction transaction = fragmentManager.beginTransaction();
fragment.setArguments(args);
if (aminEnable) {
transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
}
transaction.add(layoutId, fragment, tag);
transaction.addToBackStack(stackName);
transaction.commitAllowingStateLoss();
fragmentManager.executePendingTransactions();
}如果把linerlayout换成Relatevlayout就不会出现无法充满全屏的问题.linerlayout开头如下:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bg_main"
android:clickable="true"
android:orientation="vertical" >
<LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:background="#f7f7f7"
android:clickable="true"
android:orientation="vertical" > <org.aurora.micorprovider.views.actionbar.NormalActionBar
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/action_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:actionBarMode="none"
app:actionBarTitle="@string/account_login" /> <RelativeLayout
android:id="@+id/view_country"
android:layout_width="match_parent"
android:layout_height="@dimen/dp100"
android:background="@drawable/white"
android:orientation="horizontal"
android:paddingLeft="@dimen/dp30"
android:paddingRight="@dimen/dp30" > <TextView
android:id="@+id/textview_country"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toLeftOf="@+id/enter"
android:text="中国"
android:textColor="@color/font_gray_light"
android:textSize="@dimen/sp18" /> <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:text="@string/country"
android:textColor="@color/font_gray_light"
android:textSize="@dimen/sp18" /> <ImageView
android:id="@+id/enter"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:background="@drawable/btn_enter_bg" />
</RelativeLayout> <View
android:layout_width="match_parent"
android:layout_height="1px"
android:background="@drawable/line_dark" /> <RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/white"
android:paddingLeft="@dimen/dp30"
android:paddingRight="@dimen/dp30" > <EditText
android:id="@+id/editText_phone"
style="@style/Edit_normal"
android:layout_width="match_parent"
android:layout_height="@dimen/dp100"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/dp10"
android:layout_toRightOf="@+id/country_code"
android:background="@drawable/edit_bg_white"
android:hint="@string/account_login_account_hint"
android:inputType="number"
android:maxLength="32"
android:singleLine="true"
android:textSize="@dimen/sp18" >
</EditText> <TextView
android:id="@+id/country_code"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:text="+86"
android:textColor="@color/font_gray_light"
android:textSize="@dimen/sp18" />
</RelativeLayout> <View
android:layout_width="match_parent"
android:layout_height="1px"
android:background="@drawable/line_dark" /> <View
android:layout_width="match_parent"
android:layout_height="1px"
android:layout_marginTop="@dimen/dp20"
android:background="@drawable/line_dark" /> <EditText
android:id="@+id/editText_password"
style="@style/account_edit"
android:hint="请输入密码"
android:maxLength="20"
android:password="true"
android:singleLine="true" >
</EditText> <View
android:layout_width="match_parent"
android:layout_height="1px"
android:background="@drawable/line_dark" /> <LinearLayout
android:layout_width="match_parent"
android:layout_height="@dimen/dp80"
android:gravity="right"
android:orientation="horizontal" > <TextView
android:id="@+id/textView_find_pwd"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginRight="@dimen/dp40"
android:gravity="center"
android:text="忘记密码"
android:textColor="@color/font_yellow_drak"
android:textSize="@dimen/sp16" />
</LinearLayout> <LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp" > <Button
android:id="@+id/button_login"
style="@style/Button_normal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp40"
android:layout_marginRight="@dimen/dp40"
android:text="@string/account_login" />
</LinearLayout>
</LinearLayout>