MainActivityレイアウトのボタンがあります。フラグメントを開始するときに、このボタンをフラグメント要素で表示したいのですが、フラグメント要素のみが表示されます。私が間違っていることは何ですか?MainActivityレイアウトのボタンはフラグメントレイアウトで表示されません
MainAcivityレイアウト
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.MainActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:id="@+id/linear_layout">
<Button
android:layout_width="wrap_content"
android:layout_height="@dimen/button_height"
android:id="@+id/send_button"
android:text="SEND"
android:background="@color/circleBackground"/>
<Button
android:layout_width="wrap_content"
android:layout_height="@dimen/button_height"
android:layout_marginLeft="2dp"
android:text="SAVE"
android:id="@+id/save_button"
android:background="@color/circleBackground"/>
<ImageButton
android:layout_width="100dp"
android:layout_height="@dimen/button_height"
android:src="@drawable/ic_settings_black_24dp"
android:background="@color/circleBackground"
android:layout_marginLeft="2dp"/>
<Button
android:layout_width="wrap_content"
android:layout_height="@dimen/button_height"
android:layout_marginLeft="2dp"
android:text="+"
android:id="@+id/post_button"
android:background="@color/circleBackground"/>
</LinearLayout>
<FrameLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
フラグメントレイアウト(fragment_list)私は、アプリケーションがロードされているだけリストビューを参照してください、現在の瞬間に
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/mainBackground">
<ListView android:id="@+id/product_listview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/linear_layout"
android:dividerHeight="1dp"
android:divider="@color/circleBackground"
android:fastScrollEnabled="true">
</ListView>
。フラグメントで :
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
return inflater.inflate(R.layout.fragment_list, container,false);
}
フラグメント番号 –