第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會有你想問的

工具欄 SDK 29 中未顯示的菜單項(xiàng)

工具欄 SDK 29 中未顯示的菜單項(xiàng)

忽然笑 2023-06-04 16:55:46
我遇到的問題是菜單按鈕未顯示在工具欄中。我將一個(gè)按鈕設(shè)置為始終顯示,將一個(gè)按鈕設(shè)置為僅在有空間時(shí)顯示。沒有顯示。這是使用 Android SDK 29 (Q) 編譯的。(我在 Stack Overflow 上搜索過類似的問題,但其他問題至少是幾年前寫的,并且使用的是較舊的 SDK。)activity_main.xml   <?xml version="1.0" encoding="utf-8"?>    <androidx.constraintlayout.widget.ConstraintLayout     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:background="@color/tealBlue"    tools:context=".view.MainActivity">    <androidx.appcompat.widget.Toolbar        app:layout_constraintTop_toTopOf="parent"        android:id="@+id/toolbar_top_main"        android:layout_width="match_parent"        android:layout_height="wrap_content"        android:background="?attr/colorPrimary"        android:minHeight="?attr/actionBarSize"        android:theme="?attr/actionBarTheme"        tools:menu="@menu/top_menu_overflow"        />    <ExpandableListView        android:id="@+id/expandableListViewPolls"        android:layout_width="match_parent"        android:layout_height="0dp"        android:layout_marginTop="8dp"        android:layout_marginBottom="8dp"        android:indicatorLeft="?    android:attr/expandableListPreferredItemIndicatorLeft"        app:layout_constraintBottom_toBottomOf="parent"        app:layout_constraintTop_toBottomOf="@+id/toolbar_top_main"        tools:layout_editor_absoluteX="16dp" />    ...
查看完整描述

1 回答

?
慕少森

TA貢獻(xiàn)2019條經(jīng)驗(yàn) 獲得超9個(gè)贊

發(fā)現(xiàn)了問題。我需要在我的 MainActivity.java 中添加以下方法來擴(kuò)充菜單項(xiàng)。


@Override public boolean onCreateOptionsMenu(Menu menu) {

    MenuInflater inflater = getMenuInflater();

    inflater.inflate(R.menu.top_menu_overflow, menu);

    return true; 

}


查看完整回答
反對 回復(fù) 2023-06-04
  • 1 回答
  • 0 關(guān)注
  • 130 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號