Не найдено ни одного ресурса, соответствующего данному имени (в «menu» со значением «@ menu / bottomnavigationmain») - PullRequest
0 голосов
/ 30 июня 2018

Я пытаюсь сделать нижнюю навигацию и следую этому уроку. https://blog.xamarin.com/exploring-androids-bottom-navigation-view/. Вот код, который у меня есть в файле axml: файл: ly_homescreen.axml

<?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"
    android:layout_centerVertical="true"
    android:layout_centerHorizontal="true"
    android:background="@color/colorPrimaryDark"
    android:minWidth="25px"
    android:minHeight="25px"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin">
    <LinearLayout
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/linearLayout1">
        <ImageView
            android:src="@drawable/logo"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight="1"
            android:layout_margin="5dp"
            android:id="@+id/imageView1" />
        <FrameLayout
            android:id="@+id/content_frame"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_above="@+id/bottom_navigation" />
        <android.support.design.widget.BottomNavigationView
            android:id="@+id/bottom_navigation"
            android:layout_width="match_parent"
            android:layout_height="56dp"
            android:layout_gravity="start"
            android:layout_alignParentBottom="true"
            android:background="@android:color/white"
            app:elevation="16dp"
            app:menu="@menu/bottomnavigationmain" />
    </LinearLayout>
</RelativeLayout>

А вот код, который у меня есть в моем файле bottomnavigationmain.xml, который находится по адресу projectname>menu>bottomnavigationmain.xml. Я получаю ошибку, которую я упомянул в названии. Любая помощь приветствуется.

Если это имеет значение, я получаю сообщение об ошибке в файле bottomnavigationmain.xml:

 @(Content) build action is not supported.

1 Ответ

0 голосов
/ 01 июля 2018

Открыть свойства файла bottomnavigationmain.xml, изменить BuildAction с Content на AndroidResource

...