I assume you want to move the content within an Outline Box - let me refer to the chapter Adjust the scroll position of an Outline Box.
Hope this helps...
According to the comments above, I assume that you have a number of items placed within an Outline Box and the Outline Box is larger than a single item so that more than one items are visible on the screen. And: Only the centered item should be enabled to react on touch events.
As long as the size of a single item is identical to the size of the Outline Box, it is easy and convenient to work with EnsureVisible(). However, the method EnsureVisible() does not center a certain item - it ensures that the item is visible.
In your case, let me recommend to calculate the necessary scroll offset and set or animate the property ScrollOffset of the Outline Box. Then you can compare the ScrollOffset with the Bounds of the items in order to find the centered item.
Of course, a few lines of code are necessary to calculate and compare the positions - but at the end you get exactly the desired behavior.
What do you think about that approach?
Ask Embedded Wizard
Welcome to the question and answer site for Embedded Wizard users and UI developers.
Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!