Marcos Alves Well-Known Member Licensed User Longtime User Feb 17, 2020 #1 Hello all, I noticed that in visual designer we have the option to add the views in the activities and B4XView, but I confess that for me it's not clear yet if I'll have advantages when translating a B4A app to B4i using that kind of approach... for example, I tried to reference the padding property of an editText view declared as B4XView and didn't find this - later I saw that I must to reference in the code the B4X view as the specific element that I want to define the property. Something like this: B4X: Copy Dim textAndroid as edittext textB4x = textAndroid textAndroid.padding = array as int(1,1,1,1) This looks more complicated instead to be easier when translating to B4i... Am I wrong? What am I not seeing here?
Hello all, I noticed that in visual designer we have the option to add the views in the activities and B4XView, but I confess that for me it's not clear yet if I'll have advantages when translating a B4A app to B4i using that kind of approach... for example, I tried to reference the padding property of an editText view declared as B4XView and didn't find this - later I saw that I must to reference in the code the B4X view as the specific element that I want to define the property. Something like this: B4X: Copy Dim textAndroid as edittext textB4x = textAndroid textAndroid.padding = array as int(1,1,1,1) This looks more complicated instead to be easier when translating to B4i... Am I wrong? What am I not seeing here?
Erel B4X founder Staff member Licensed User Longtime User Feb 17, 2020 #2 Why aren't you setting the padding in the designer? Upvote 0
Marcos Alves Well-Known Member Licensed User Longtime User Feb 17, 2020 #3 Erel said: Why aren't you setting the padding in the designer? Click to expand... Because in runtime I add some views dynamically whose will define if I'll need or not to change the properties of others. The padding is only an example but there are some other specific properties in imageViews, for example, those aren't available in B4Xviews and must to be referenced in the code if you need to use them... am I doing something wrong? Upvote 0
Erel said: Why aren't you setting the padding in the designer? Click to expand... Because in runtime I add some views dynamically whose will define if I'll need or not to change the properties of others. The padding is only an example but there are some other specific properties in imageViews, for example, those aren't available in B4Xviews and must to be referenced in the code if you need to use them... am I doing something wrong?
Erel B4X founder Staff member Licensed User Longtime User Feb 17, 2020 #4 I've asked this question because the best way to set the platform specific features is with the designer. If you are adding views dynamically then you must start with the native type. You can later switch to a B4XView. This is not really relevant to this discussion. There is no right or wrong here. If you are building cross platform solutions then you should prefer using B4XViews. There are also other advantages to B4XViews. And you can always switch back and forth between the types so it is not a too important decision. Upvote 0
I've asked this question because the best way to set the platform specific features is with the designer. If you are adding views dynamically then you must start with the native type. You can later switch to a B4XView. This is not really relevant to this discussion. There is no right or wrong here. If you are building cross platform solutions then you should prefer using B4XViews. There are also other advantages to B4XViews. And you can always switch back and forth between the types so it is not a too important decision.
Marcos Alves Well-Known Member Licensed User Longtime User Feb 17, 2020 #5 Erel said: I've asked this question because the best way to set the platform specific features is with the designer. If you are adding views dynamically then you must start with the native type. You can later switch to a B4XView. This is not really relevant to this discussion. There is no right or wrong here. If you are building cross platform solutions then you should prefer using B4XViews. There are also other advantages to B4XViews. And you can always switch back and forth between the types so it is not a too important decision. Click to expand... Thanks @Erel , I was worried because I'm writing some large apps in B4A and will need to convert to B4i later - I was really thinking if either to check or not the B4XView in "Generate Members" designer tool was something that I could to regret later ... Really thanks! Upvote 0
Erel said: I've asked this question because the best way to set the platform specific features is with the designer. If you are adding views dynamically then you must start with the native type. You can later switch to a B4XView. This is not really relevant to this discussion. There is no right or wrong here. If you are building cross platform solutions then you should prefer using B4XViews. There are also other advantages to B4XViews. And you can always switch back and forth between the types so it is not a too important decision. Click to expand... Thanks @Erel , I was worried because I'm writing some large apps in B4A and will need to convert to B4i later - I was really thinking if either to check or not the B4XView in "Generate Members" designer tool was something that I could to regret later ... Really thanks!
Erel B4X founder Staff member Licensed User Longtime User Feb 17, 2020 #6 See this tutorial: https://www.b4x.com/android/forum/threads/b4x-sharing-layouts-between-platforms.109296/#content Upvote 0
See this tutorial: https://www.b4x.com/android/forum/threads/b4x-sharing-layouts-between-platforms.109296/#content
Marcos Alves Well-Known Member Licensed User Longtime User Feb 17, 2020 #7 Erel said: See this tutorial: https://www.b4x.com/android/forum/threads/b4x-sharing-layouts-between-platforms.109296/#content Click to expand... Great @Erel !!! Thanks!? Upvote 0
Erel said: See this tutorial: https://www.b4x.com/android/forum/threads/b4x-sharing-layouts-between-platforms.109296/#content Click to expand... Great @Erel !!! Thanks!?