LucaMs Expert Licensed User Longtime User Jan 21, 2021 #1 I am trying to create a custom XUI view. In it I load a layout using CallSubDelayed, as is necessary. The layout contains only a B4XImageView (it's just a test, certainly not a useful custom view). The CV has a property to set the B4XBitmap of this B4XImageView. In the B4J project that uses it I had to add a Sleep (0) so that the sw did not crash; in the B4A project not even this is enough. Attachments XuiCVTest.zip XuiCVTest.zip 44.4 KB · Views: 278
I am trying to create a custom XUI view. In it I load a layout using CallSubDelayed, as is necessary. The layout contains only a B4XImageView (it's just a test, certainly not a useful custom view). The CV has a property to set the B4XBitmap of this B4XImageView. In the B4J project that uses it I had to add a Sleep (0) so that the sw did not crash; in the B4A project not even this is enough.
Erel B4X founder Staff member Licensed User Longtime User Jan 21, 2021 #2 1. Where is the error message? 2. No need to use CallSubDelayed in DesignerCreateView. Better to add Sleep(0). Code: Copy Public Sub DesignerCreateView (Base As Object, Lbl As Label, Props As Map) mBase = Base Tag = mBase.Tag mBase.Tag = Me Sleep(0) mBase.LoadLayout("layCVTest") End Sub Upvote 0
1. Where is the error message? 2. No need to use CallSubDelayed in DesignerCreateView. Better to add Sleep(0). Code: Copy Public Sub DesignerCreateView (Base As Object, Lbl As Label, Props As Map) mBase = Base Tag = mBase.Tag mBase.Tag = Me Sleep(0) mBase.LoadLayout("layCVTest") End Sub
LucaMs Expert Licensed User Longtime User Jan 21, 2021 #3 Erel said: 1. Where is the error message? Click to expand... It is in the project ? (sorry). B4XImageView1 is not yet initialized. Upvote 0
Erel said: 1. Where is the error message? Click to expand... It is in the project ? (sorry). B4XImageView1 is not yet initialized.
Erel B4X founder Staff member Licensed User Longtime User Jan 21, 2021 #4 You need to keep the Sleep(0) in the main page. I will add an option to add it programmatically. Upvote 0
LucaMs Expert Licensed User Longtime User Jan 21, 2021 #5 Erel said: You need to keep the Sleep(0) in the main page. I will add an option to add it programmatically. Click to expand... But it only works in B4J, in B4A it crashes anyway (even setting Sleep (200)) Upvote 0
Erel said: You need to keep the Sleep(0) in the main page. I will add an option to add it programmatically. Click to expand... But it only works in B4J, in B4A it crashes anyway (even setting Sleep (200))
LucaMs Expert Licensed User Longtime User Jan 21, 2021 #6 Is B4XImageView class the problem? Upvote 0
LucaMs Expert Licensed User Longtime User Jan 21, 2021 #7 LucaMs said: Is B4XImageView class the problem? Click to expand... No; I tried with a native ImageView (B4A), same error, not intialized. Upvote 0
LucaMs said: Is B4XImageView class the problem? Click to expand... No; I tried with a native ImageView (B4A), same error, not intialized.
Erel B4X founder Staff member Licensed User Longtime User Jan 21, 2021 #8 Upload the updated project. Upvote 0
LucaMs Expert Licensed User Longtime User Jan 21, 2021 #9 Erel said: Upload the updated project. Click to expand... Ehm... already changed... Upvote 0
LucaMs Expert Licensed User Longtime User Jan 21, 2021 #10 Erel said: Upload the updated project. Click to expand... Attachments XuiCVTest2.zip XuiCVTest2.zip 44.1 KB · Views: 282 Upvote 0
LucaMs Expert Licensed User Longtime User Jan 21, 2021 #11 Removing the CV from the main layout and adding it again, it works (B4A native ImageView; I have to test with B4XImageView but I suppose it will work). Upvote 0
Removing the CV from the main layout and adding it again, it works (B4A native ImageView; I have to test with B4XImageView but I suppose it will work).
LucaMs Expert Licensed User Longtime User Jan 21, 2021 #12 LucaMs said: I have to test with B4XImageView but I suppose it will work Click to expand... Confirmed Upvote 0
LucaMs said: I have to test with B4XImageView but I suppose it will work Click to expand... Confirmed