Android Question B4X views not shown correctly in Designer

toby

Well-Known Member
Licensed User
Longtime User
I'm using B4A 9.80 and I'm having some problems while trying to add some b4x views to my project

For new projects, all I need is to add xui views library and everything works as expected.

For my existing project, I get b4xplusminus view without adding the xui views library, which is weird. If the xui views library is added, no b4x views is shown, but even the b4xplusminus view.

There is likely some kind of conflict unknown to me. Any hint,? please.
 

Attachments

  • blank project.jpg
    blank project.jpg
    325.7 KB · Views: 160
  • b4xplusminusOnly.jpg
    b4xplusminusOnly.jpg
    434 KB · Views: 154
  • xuiViewsNotShown.jpg
    xuiViewsNotShown.jpg
    382.9 KB · Views: 161

toby

Well-Known Member
Licensed User
Longtime User
You were right! Earlier I added b4xplusminus.bas to my project and I forgot about it. After removing the module, all b4x views appear correctly in the designer.

thanks
 
Upvote 0

toby

Well-Known Member
Licensed User
Longtime User
There is no relation between B4XView and XUI Views.

Strange indeed. For me, without checking xui view library, no b4x view would appear in the designer.

What's the proper way to get b4x views to show?
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
What do you mean with b4x view ?

You cannot add B4XViews directly in the Designer.
You need to add 'standard' views like Panel, Label, ImageView etc.
But, you can, then declare them as B4XViews in the code with:

1587663843416.png


Example with a Panel.
 
Upvote 0

toby

Well-Known Member
Licensed User
Longtime User
What do you mean with b4x view ?

You cannot add B4XViews directly in the Designer.
You need to add 'standard' views like Panel, Label, ImageView etc.
But, you can, then declare them as B4XViews in the code with:

View attachment 92482

Example with a Panel.

The B4x views I was talking about are the views with "B4X" prefix in the designer under Customview, such as b4xplusminus, b4xCombobox, b4xFloatingTextField.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
such as b4xplusminus
b4xplusminus
This search leads you to the (1st result) page

Here you can read that this view is part of "XUI Views" library. It is a internal library you just need to mark in the library tab.
B4XPlusMinus is a cross platform control introduced in XUI Views v2.05
 
Upvote 0

toby

Well-Known Member
Licensed User
Longtime User
This is a dummy project without any code. I first saved the project in order to open the designer. After I select Add View from the menu, I see that the CustomView entry is disabled; I don't see those B4Xxxx views anywhere.

At this point, if I add xui views library, the Customview entry would be enabled and the B4Xplusminus (and b4xFloatingTextfield, etc) would appear under it.
 

Attachments

  • testB4xViews.zip
    7.3 KB · Views: 132
Upvote 0

toby

Well-Known Member
Licensed User
Longtime User
Well, now I am lost!
The project you posted works as expected !!!???
So, what's the problem?

If I understood Erel correctly, the way, by checking xui views library, I add B4Xxxx views (b4xplusminus, b4xFloatingTextField, b4xSignature, etc) is wrong. I'll watch the video, suggested by erel, asap.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
If I understood Erel correctly, the way, by checking xui views library, I add B4Xxxx views (b4xplusminus, b4xFloatingTextField, b4xSignature, etc) is wrong.
I think you got confused by the Terms in some way?

A B4XView is not a real View but a kind of Wrapper around standard views like Label, Panel, Buttons....

b4xplusminus is a Class. Under the line it can be wrapped in a b4xview.
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
I'm afraid that there is still a misunderstanding!
Erel speaks of B4XViews, which are supersets of 'standard' views, that's what I tried to explain in post#6.
To use these, you need the XUI library.

The B4Xxxx views you are referring to are included in the XUI Views library.
The project in your post#10, works as expected!
If you check the XUI Views library in the Libraries Manager Tab you can choose them in the Designer and if you uncheck this library you cannot select these objects!
If you add a B4XPlusMinus object and then uncheck the XUI Views library you'll get an error during compilation!
 
Upvote 0

toby

Well-Known Member
Licensed User
Longtime User
Thank you @DonManfred & @klaus for clarifying it. That means I use them correctly but mentioned them incorrectly, They should be called XUI views, not B4X views. The reason I called them b4x views is they all have "b4x" prefix (b4xPlusMinus, b4xSignature, ....)
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
The reason I called them b4x views is they all have "b4x" prefix (b4xPlusMinus, b4xSignature, ....)
I agree with you Toby. The terminology is confusing. When in doubt, just put a check in the XUI Views library pane. It will take care of XUI and customlistview libraries as they are referenced automatically with the use of XUI Views.
 
Upvote 0
Top