Help with views

stevel05

Expert
Licensed User
Longtime User
Hi

I am trying to understand the use of views within B4A, I am having problems getting a view to display.

I have created an app which contains one activity and two views, which works as I expect. These use a basic view generated in Designer which is then added to in the program. The structure ends up as (I think)

Activity
|
ScrollView
|
Panel
|
Canvas

I am using the canvas to display text to save creating hundreds of labels (as per previous post).

Now I want to add a further panel that overlays the Canvas when the screen is touched/clicked. I think the structure should now be:

____ Activity_____
|----------|
ScrollView Panel2
|
Panel
|
Canvas


I have created the layout in designer and loaded it into a new panel, but how do I get it to display when the first panel is clicked?

I attach an example program that is just the view management. I am sure I am missing something simple.

One further question, what is the difference between a click and a touch? or is it just the information that is returned that differs.

**Edit** I should have added that from the first screen select any item, then click on the second screen, this is where I want to display the new panel.

Thanks in advance.

Steve
 

Attachments

  • testapp.zip
    7.2 KB · Views: 222
Last edited:

Erel

B4X founder
Staff member
Licensed User
Longtime User
Canvas is not a View. It is a drawing tool that allows you to draw over bitmaps or views.

One further question, what is the difference between a click and a touch? or is it just the information that is returned that differs.
A click happens when the user presses on the view and releases it. During a single click many Touch events can be raised.
The first one will be with Action = Activity.ACTION_DOWN. Then there can many events with Action = Activity.ACTION_MOVE. Eventually another event will be raised with Activity.ACTION_UP.
 
Upvote 0

alfcen

Well-Known Member
Licensed User
Longtime User
As far as I can see, Activity_Click and Activity_LongClick are disabled if you have an Activity_Touch event.

This is not handy, by a required physical restriction - so I believe.
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
Yes, I noticed it was either touch or click, I didn't try long click but I am sure you're right.
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
I can get the additional panel to display if I create it within the program, so problem solved for now

It would be interesting to know what I've got wrong using the designer for future reference. I have since read that you cant add items to the scroll view in the designer, so I know that's wrong, but it didn't help in displaying it.

Steve
 
Upvote 0
Top