Android Question How to Load images Bxdrawer

Discussion in 'Android Questions' started by Makumbi, Jun 25, 2019.

  1. Makumbi

    Makumbi Active Member Licensed User

    i have this line of code where i want to include images
    Code:
    ListView1.AddSingleLine( cs.Initialize.Typeface(Typeface.MATERIALICONS).Size(22).VerticalAlign(3dip).Append(Chr(0xE145)).PopAll.Append("Profile") )
        ListView1.AddSingleLine( cs.Initialize.Typeface(
    Typeface.MATERIALICONS).Size(22).VerticalAlign(3dip).Append(Chr(0xE190)).PopAll.Append("Change Number") )
        ListView1.AddSingleLine( cs.Initialize.Typeface(
    Typeface.MATERIALICONS).Size(22).VerticalAlign(3dip).Append(Chr(0xE86A)).PopAll.Append("CheckBalance") )
        ListView1.AddSingleLine( cs.Initialize.Typeface(
    Typeface.MATERIALICONS).Size(22).VerticalAlign(3dip).Append(Chr(0xE3B0)).PopAll.Append("Academics") )
        ListView1.AddSingleLine( cs.Initialize.Typeface(
    Typeface.FONTAWESOME).Size(22).VerticalAlign(3dip).Append(Chr(0xF1C0)).PopAll.Append("Past Records") )
        ListView1.AddSingleLine( cs.Initialize.Typeface(
    Typeface.FONTAWESOME).Size(22).VerticalAlign(3dip).Append(Chr(0xF0E4)).PopAll.Append("New Admissions") )
        ListView1.AddSingleLine( cs.Initialize.Typeface(
    Typeface.FONTAWESOME).Size(22).VerticalAlign(3dip).Append(Chr(0xF27B)).PopAll.Append("AccountStatement") )
        ListView1.AddSingleLine( cs.Initialize.Typeface(
    Typeface.FONTAWESOME).Size(22).VerticalAlign(3dip).Append(Chr(0xF085)).PopAll.Append("Simple Chat") )
    this is the old slidemenu that i have been using

    Code:
    sm.Initialize(Activity, Me, "SlideMenu"42dip180dip)
        sm.AddItem(
    "Profile"LoadBitmap(File.DirAssets, "info.png"), 1)
        sm.AddItem(
    "Change Number"LoadBitmap(File.DirAssets, "book_add.png"), 2)
        sm.AddItem(
    "CheckBalance"LoadBitmap(File.DirAssets, "book_open.png"), 3)
        sm.AddItem(
    "Academics"LoadBitmap(File.DirAssets, "degree.png"), 4)
        sm.AddItem(
    "Past Records"LoadBitmap(File.DirAssets, "degree.png"), 6)
        sm.AddItem(
    "New Admissions"LoadBitmap(File.DirAssets, "sms.png"), 9)
        sm.AddItem(
    "AccountStatement"LoadBitmap(File.DirAssets, "calculator.png"), 10)
        sm.AddItem(
    "Simple Chat"LoadBitmap(File.DirAssets, "chat.ico"), 5)
        sm.AddItem(
    "School Events",LoadBitmap(File.DirAssets, "book_open.png"), 7)
        sm.AddItem(
    "Help",LoadBitmap(File.DirAssets, "help.png"), 11)
        sm.AddItem(
    "Exit App",LoadBitmap(File.DirAssets, "lynda.png"), 8)
     
  2. Makumbi

    Makumbi Active Member Licensed User

    Code:
    ListView1.AddSingleLine( cs.Initialize.Typeface(Typeface.FONTAWESOME).Size(22).VerticalAlign(3dip).Append.Image((LoadBitmap(File.DirAssets, "chat.ico"), 40dip40dipFalse)).PopAll.Append("Simple Chat"))
    i have tried out this but it is bringing error missing Parameter Please help
     
  3. Jorge M A

    Jorge M A Active Member Licensed User

  4. Erel

    Erel Administrator Staff Member Licensed User

    You can add whichever views you like to B4XDrawer. Use xCLV instead of ListView and add items with bitmaps.
     
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