Can I increase a buttons onclick-area programmatically?
        Posted  
        
            by sandis
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by sandis
        
        
        
        Published on 2010-06-01T11:42:50Z
        Indexed on 
            2010/06/01
            12:03 UTC
        
        
        Read the original article
        Hit count: 356
        
Sometimes I have a button in my UI that it is so small that it is difficult to click. My solution so far has been to add a transparent border around the button in photoshop. Just increasing the padding on the button does not work, since this will also stretch the image. Since it is kind of a fuss to open photoshop each time I want to change the clickable surface, is there any way to do this programmatically? I have tried placing a framelayout behind the button and make it clickable, but then the button wont change appearance on touch as it should. Ofcourse I could also add a ontouchlistener on the framelayout which changes the buttons appearance, but then it quite some code if I have several of those buttons.
Cheers,
© Stack Overflow or respective owner