Android Studio layout design view doesn't show menu bar items? - android-studio

i've defined a simple menu in res/menu/simple_menu.xml, with a single item called TITLE2. i then iflate this menu in my MainActivity, and all is good (See device screenshot on right, where my TITLE2 is visible in the action bar top right. however, in the layout preview (activity_main.xml, Design view, left image in below) the menu item is not visible! is this intentional? is there a way to get my menu items to show up in preview mode? thanks,

<item
android:title="TITLE2"
app:actionProviderClass="com.example.chimee.MyActionProvider"
app:showAsAction="collapseActionView"/>
play with showAsAction for a while collapseActionView will add an item menu to a vertical list menu Something like this:

is there a way to get my menu items to show up in preview mode?
No, because the menu items show up in the action bar after you inflate it in your Kotlin/Java code.

Related

How do I define the items in the menu row or even better have the default format menu item appear in the toolbar?

I changed menu to this:
menubar: 'format table tools help'
But what appears in the menu in my editor is just format. Table, tools, and help don't appear. Why is that so?
Also, if I want to get rid of the menubar I know I need to set
menubar: false
but is there a way of getting that nice format item from the menubar into the toolbar?
Thanks.
In order for the item to appear in the menu you also need to load the plugin itself. If (for example) you don't load the help plugin TinyMCE won't show a Help menu because the underlying functionality is not loaded.
is there a way of getting that nice format item from the menubar into
the toolbar?
The short answer is "no". A menu item and a toolbar item are different. That being said, many of the capabilities exposed via the Menubar can also be exposed via the Toolbar.
Here is an example of loading both the Help menu option as well as the toolbar button.
https://fiddle.tiny.cloud/S5haab

Buttons not visible in the Layout Editor of Android Studio 3.4

Although many tutorials, videos, and books in Internet show the baseline edit. delete constraint and cycle chain mode buttons (x, ab and chainbuttons) below the selected component in the Layout Editor, I can't see them in my updated Android Studio 3.4. How is it possible? I can only do these operations with the context menu.
You can find menu to toggle Baseline from context menu e.g
Activity Design View > Component Tree
Select button2 and right-click to bring up the Context menu on button2
They have updated and move the option to the right click menu
You have to right click your TextView component and show baseline

Navigation in Xamarin.Form from masterdetail page

I am new to Xamarin and want to develop an Xamarin.Form Portable App.For that, I have created the project template as Xamarin.Form Portable.
After login, I have successfully created a Master Detail Page to display the Menu List like Home, AboutUs, ContactUs links in the left corner which is initially hide and when i click on the Menu Icon (Menu Icon is like three dashes(-) in parallel) all Menu List is populated to the right side in window. Now when i click on any Menu Item,I don't want to repeat the menu list or its icon in the inner pages. Instead of that, I want Navigation back arrow button instead of the Menu Icon. When I tried to navigate it like below it gives me error like "PushAsync is not supported globally on iOS/Android, please use a NavigationPage"
await Navigation.PushAsync(new AboutUs());
If instead of this, I navigate it to the master detail page and set the About Us page as Detail property of the Master Detail Page then Menu Icon and Menu list will be reapeated which i don't want. Please help me how can i show the navigate the page with Back Arrow button in inner pages.
Overall, I want functionality like in Gmail where when we open any Detail of Email Menu button is not there but the back arrow button is there.
Thanks in advance!
Try this approach(Because DetailPage must be NavigationPage in Xamarin.Forms):
await Navigation.PushAsync(new NavigationPage(new AboutUs()));

Can't add icon to Action Right Click Drop Down Menu in Notes Client View

I am trying to add an icon to the Right Click, Drop Down Menu , on an Action, in a View. The icon shows up in the Action Bar (with no text, but that is how it's supposed to work) at the top (see image) but in the drop down menu, it does not appear, only the text does. Is there something I am missing? Is this not suppported?
In my opinion this feature is only supported for actions in the action bar:

Anyone know how to create a custom menu like this in android apps?

hii,I was just learning android i want create menu like this at this image This Menu
i was confused make this,anyody know how i can do it with 4 item like the link above ?
please help me.
sory if my language english bad.
To my knowledge custom menu and options menu can be modified (adding and removing menu items) easily.
If u want your own custom option menu, you may have to simulate by creating layouts.
1) Creative a layout and inflate the layout and show on clicking on the menu button.
2) If u want to occupy whole screen then better use Images and TextViews and create a new activity and launch the activity on clicking the options menu in OnCreateOptionsMenu().
Please find the links below
Custom menu in android
Android: creating a custom menu on the bottom

Resources