9-patch background image affects margins?

by Jason Proctor » Tue, 16 Feb 2010 08:16:57 GMT


Sponsored Links
 i have list views with image views and text views etc in them, and 
i'm trying to fix up a situation where the background image of a list 
element changes in the "pressed" state.


if there's a straightforward way of doing that, please let me know!

right now, i override onTouchEvent() in the topmost view, and also in 
those child views who don't just delegate to their parents -- which 
would be image views. i have to check for long clicks myself, but 
basically this scheme works.


the list views are potentially different sizes depending on how much 
text is in the views etc, so i thought i would use a 9-patch as the 
background. however, when the background changes from flat white to 
the 9-patch, this seems to indent the view a bit -- ie give it 
margins.


eh? if i change the image to a non-9-patch, the margins remain as 
they are. i've tried different sizes of 9-patch, from 320x150 or so 
down to 100x30 etc, no change.


what's going on?

thanks
--
jason.vp.engineering.particle

--



9-patch background image affects margins?

by skink » Tue, 16 Feb 2010 16:06:14 GMT


 On Feb 16, 1:16am, Jason Proctor <jason.android.li...@gmail.com>



9patches affect padding (see bottom & right black control lines)

pskink

--


Sponsored Links


9-patch background image affects margins?

by Jason Proctor » Wed, 17 Feb 2010 02:50:55 GMT


 
9patches affect padding (see bottom & right black control lines) pskink
great - thanks! -- jason.vp.engineering.particle --



Other Threads

1. Think Big

Think Big  : Every king was once a Crying baby and every great
Building was once a Blueprint. its not where u r today. but where u'll
reach tomorrow.
for more info : http://123maza.com/50/daxman/

-- 

2. Question on a Work at Home Program

Has anyone had experience with this work at home program ?
http://tinyurl.com/ykjnasp



-- 

3. How Do You Write Songs?

4. MapView zoom listener

5. How to lookup in contacts table for the contact of the incoming sms

6. Greyscale image while getting data array from onPictureTaken

7. maaf repost..WTS HTC ERIS CDMA dan WTB HTCmagic / hero