На самом деле я хочу добавить меню Action Bar в мой макет, указанный ниже, я не понимаю, как поместить в него меню Action. Может ли кто-нибудь помочь мне в решении этой проблемы ...Как добавить панель действий в relativeLayout
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:id="@id/action_bar"
>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Enable Pin"
android:id="@+id/button"
android:layout_marginBottom="140dp"
android:layout_alignParentBottom="true"
android:layout_alignEnd="@+id/button2"
android:layout_alignStart="@+id/button2" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Enable Pattern"
android:id="@+id/button2"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="51dp" />
</RelativeLayout>
эй @ali, что я хочу, чтобы показать панель действий на моей странице после главного экрана с заголовком «Включить контакт» ... для этого, что мне делать? – Sam
эй @ Попробуйте добавить getSupportActionBar(). SetDisplayShowTitleEnabled (true); getSupportActionBar(). SetTitle ("title"); после setSupportActionBar (панель инструментов); –