03-08-2013 05:52 AM
So I am testing this on the simulator, but for some reason when I create a Button or even an ImageView, there seems to be extra space to the right of it.
The extra space is about 30-40 pixels worth to the right. I want the bounds of the onClick to be exactly till the edges of the Button or ImageView, not any further.
Is it soppose to have this extra, invisable space next to these components? I have all my margins set to 0, and even the padding set to 0. Not sure why it's acting like this.
Solved! Go to Solution.
03-08-2013 08:18 AM
Can you post a sample of the code that does this behaviour? It can be difficult to control the width of buttons but it should be easy to control the width of an ImageView.
03-08-2013 02:56 PM
Yeah the space is there. I never noticed it before. Just a simple Button with onClicked has it. No other special code. Even when you use preferredWidth, the clicking area is wider than the button.
03-09-2013 08:10 AM
I see. If you really need this turned off, I would try placing a small 1x1 container with onClick defined on all sides where you don't want the overflow from the button to occur. Place the image right next to it so it's touching the button. I think this will stop the touch boundary from the button from overflowing around it because there will be touchable areas in the immediate space around it.
This is a hack but I think it might work.