Nickelgrass Active Member Licensed User Longtime User Jan 21, 2022 #1 Hello, I have a custom view. In my activity I add a Scrollview. If I want to add my view it gives me warning 22 (Types do not match). Then I changed the view from cutsomview to customview(XUI) and the Scrollview to a xCustomListView but exactly the same. Code: Copy Dim gui_item As cv_can_display gui_item.init(id, "suffix", 0x00FFFF) GuiList.Panel.AddView(gui_item, offset*ITEMHEIGHT, 0dip, GuiList.Width, 100dip) offset = offset + 1 How can I make a Scrollview and load my cutsom views in there? I thought the CustomListView was the way to go but no luck. The error was GuiList.Panel.AddView(gui_item, offset*ITEMHEIG src\b4a\example\sample_app.java:499: error: incompatible types: cv_can_display cannot be converted to View mostCurrent._guilist.getPanel().AddView((android.view.View)(_gui_item),(int) (_offset*_itemheight),anywheresoftware.b4a.keywords.Common.DipToCurrent((int) (0)),mostCurrent._guilist.getWidth(),anywheresoftware.b4a.keywords.Common.DipToCurrent((int) (100))); Thanks
Hello, I have a custom view. In my activity I add a Scrollview. If I want to add my view it gives me warning 22 (Types do not match). Then I changed the view from cutsomview to customview(XUI) and the Scrollview to a xCustomListView but exactly the same. Code: Copy Dim gui_item As cv_can_display gui_item.init(id, "suffix", 0x00FFFF) GuiList.Panel.AddView(gui_item, offset*ITEMHEIGHT, 0dip, GuiList.Width, 100dip) offset = offset + 1 How can I make a Scrollview and load my cutsom views in there? I thought the CustomListView was the way to go but no luck. The error was GuiList.Panel.AddView(gui_item, offset*ITEMHEIG src\b4a\example\sample_app.java:499: error: incompatible types: cv_can_display cannot be converted to View mostCurrent._guilist.getPanel().AddView((android.view.View)(_gui_item),(int) (_offset*_itemheight),anywheresoftware.b4a.keywords.Common.DipToCurrent((int) (0)),mostCurrent._guilist.getWidth(),anywheresoftware.b4a.keywords.Common.DipToCurrent((int) (100))); Thanks
klaus Expert Licensed User Longtime User Jan 21, 2022 #2 How did you create your CustoView. If you want to add a CusromView by code you can: - Make a layout file with just your CustomView and load it when needed. - Add a AddToParent routine in your CustomView code. You may have a look at chapeter 4.3 Adding a custom view by code in the B4X CustomViews booklet. Upvote 0
How did you create your CustoView. If you want to add a CusromView by code you can: - Make a layout file with just your CustomView and load it when needed. - Add a AddToParent routine in your CustomView code. You may have a look at chapeter 4.3 Adding a custom view by code in the B4X CustomViews booklet.
Nickelgrass Active Member Licensed User Longtime User Jan 21, 2022 #3 Ah, thank you. Now I understand what the GetBase sub is for in the customviewclass module. Code: Copy GuiList.Panel.AddView(gui_item.GetBase, offset*ITEMHEIGHT, 0dip, GuiList.Width, 100dip) This worked too. Upvote 0
Ah, thank you. Now I understand what the GetBase sub is for in the customviewclass module. Code: Copy GuiList.Panel.AddView(gui_item.GetBase, offset*ITEMHEIGHT, 0dip, GuiList.Width, 100dip) This worked too.