Android Question AddMenu3 questions

Discussion in 'Android Questions' started by Alberto Michelis, Jun 16, 2015.

  1. Alberto Michelis

    Alberto Michelis Active Member Licensed User

    1) Any way to add the menu conditionally, that is enter the activity without the menu item and by a spinner change activate or deactivate the menu item?
    2) In Poltrait mode the menu appears allways in the back of the screen and in landscape, in the action bar.
    My icon is very small and the actionbar title too but it never appears in the action bar in poltrate mode.
    Thanks
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    1) Not unless you create a custom action bar.
    2) Can you post the relevant code and the icon file?
     
  3. Alberto Michelis

    Alberto Michelis Active Member Licensed User

    Code:
    Activity.LoadLayout("posicion")            
      
    Activity.Title = "PortIt - Tenencia"
      
    Activity.AddMenuItem3("""mnuAgregar"LoadBitmap(File.DirAssets, "ic_agregar.png"), True)
     

    Attached Files:

  4. Erel

    Erel Administrator Staff Member Licensed User

    Try to use a 16x16 icon instead.
     
  5. Alberto Michelis

    Alberto Michelis Active Member Licensed User

    tride with this and same problem...
     

    Attached Files:

  6. Erel

    Erel Administrator Staff Member Licensed User

    Are you sure that it is 16x16? Looks like it is 24x24. Can you upload it in a zip file?
     
  7. Alberto Michelis

    Alberto Michelis Active Member Licensed User

    You are right, I change it to 16x 16 (attached) and same problem, it is still in the bottom bar but smaller...
    I've attached a screen image too.
     

    Attached Files:

  8. Erel

    Erel Administrator Staff Member Licensed User

    Sorry I didn't understand that it appears in the bottom bar. Have you set this attribute in the manifest editor:
    SetApplicationAttribute(android:uiOptions, "splitActionBarWhenNarrow") ?

    Is this a phone or a tablet?
     
  9. Alberto Michelis

    Alberto Michelis Active Member Licensed User

    Yes I have SetApplicationAttribute(android:uiOptions, "splitActionBarWhenNarrow")
    in the manifest.

    If I comment it then the icon is shown ok in the app bar, but there are many space to do that with the WhenNarrow option.

    This is a Phone, a samsung note 3 running android 4.4.2
     

    Attached Files:

  10. Erel

    Erel Administrator Staff Member Licensed User

    If you set this attribute then the menu will appear at the bottom of the screen in portrait mode. This is the purpose of this attribute.
     
  11. Alberto Michelis

    Alberto Michelis Active Member Licensed User

    As I read, this may happend only if theres no place for the icons in the toolbar.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice