Я использую Навигационный ящик, но каждый раз, когда я что-то помещаю во фрагмент, панель действий не учитывает макет.App Theme (Actionbar) не уважает ваше пространство
Само изображение объясняет:
fragment_main:
<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="com.example.leonel.picollo.MainFragment">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="MAIN"
android:padding="8dp"
android:textColor="#fff"
android:background="@color/colorPrimary"
android:textSize="28sp"
android:id="@+id/textView"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
/>
</RelativeLayout>
И MainFragment.java:
package com.example.leonel.picollo;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
public class MainFragment extends Fragment {
public MainFragment() {
// Required empty public constructor
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
return inflater.inflate(R.layout.fragment_main, container, false);
}
}
У вас есть (XML) код, который вы можете нам показать? – Nathan
Конечно, но какой класс? –
Tasso Guimareas fragment_main.xml и MainFragment.class также могут помочь. – Nathan