B4J Question What are the pitfalls that you should avoid when creating Custom Views? or perhaps Lessons Learned?

Mashiane

Expert
Licensed User
Longtime User
Ola

I have been developing and creating custom views for a while now. There are some things that I have wished I knew earlier, and perhaps some that I should learn.

I am curious though, with the vast experience in the forum, what has been the pitfalls and lessons learned when creating custom views?

This is for all those "Ooops" moments, when you realize that, you were not supposed to code it that way?

As an example, its better to use .GetDefault rather than .Get when reading the properties?

What other pitfalls are there that you have discovered, what have you learned? what are the best recommended approaches. Something like a "health check", if your custom view meets these requirements, then its health is 100% or perhaps 0%.

This helps us in coding better. Lets share please.


Thanks
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
As an example, its better to use .GetDefault rather than .Get when reading the properties?
Good example, it is relevant when you add a new property after the library was released.

If it is a cross platform view then you must test it on all three platforms (B4A, B4i and B4J).

You should also think about the view's behavior when its parent is resized. For example when it is anchored to both sides.
 
Upvote 0
Top