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 

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?



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)



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. Whats the intent ?

Hey guys,

Im trying something, im just stuck on finding the intent to get to
this screen :mad:

I can get to this screen



adb shell am start -a android.intent.action.MAIN -n

I wanna know how i can get to any of the application subscreens so


Is there any intent for going into specific app settings ?

When monitoring the logs to find the intents. I notice it says

/.InstalledAppDetails <has extras>

ne clue as to what these "extras" are ?



2. weather info on map depending on the lat and long

Hi all,

display the weather forecast depending on the user lat and long .pl help me
it's very urgent to me.

i already sent mails to this group but i am not getting any reply

pl any one having solution for this help me

Thanks & Regards



3. RelativeLayout added using LayoutInflater and addView doesn't obey fill_parent?

4. Searchify: Expand your search bar functionalit

5. (Repost) WTB: Nexus One BNIB (Sudah Dapat)

6. buat user G1/Dream, ada Amon_Ra Recovery baru ni

7. life-cycle clarification help