1. Are you ready for the Galaxy S20? Here is everything we know so far!

Android Rounded Corner Layout with Filled Tiled Image

Discussion in 'Android Development' started by New Guy5, Oct 15, 2014.

  1. New Guy5

    New Guy5 Lurker
    Thread Starter

    I'm hoping there is an xml solution to this... I am trying to create a layout that has rounded corners and then filling that layout with an image (tiled, repeat). So basically I have a LinearLayout that has a drawble layered-list assigned to the background. Here is the test layout (xml):

    here is the test_rounded drawable xml:

    The image is overflowing at the corners of the shape/layout border. I get the following

    [​IMG]

    corners are overflowed here

    As you can see the corners are overflowed. I heard about modifying the image part (blue pattern) in code but I have issues with that since I do modify it and animate it along the way. SO, if its at all possible to just fill in the layout with that image, please let me know. Thank you all for your help.
     



    1. Download the Forums for Android™ app!


      Download

       
  2. New Guy5

    New Guy5 Lurker
    Thread Starter

  3. New Guy5

    New Guy5 Lurker
    Thread Starter

  4. New Guy5

    New Guy5 Lurker
    Thread Starter

  5. New Guy5

    New Guy5 Lurker
    Thread Starter

  6. New Guy5

    New Guy5 Lurker
    Thread Starter

    bump ****
     
  7. deprogram

    deprogram Lurker

    Views in Android are rectangular, so I'd expect this behavior, regardless of how you stroke the outline of the view.

    Apparently it -is- possible to hook the OnDraw() method of the Canvas and actually clip the area based on a path. Check it:
    Is it possible to mask a View in android? - Stack Overflow
     
Loading...
Similar Threads - Android Rounded Corner
  1. Scadica
    Replies:
    0
    Views:
    132
  2. SrLimon
    Replies:
    0
    Views:
    144
  3. Olive
    Replies:
    2
    Views:
    159
  4. charlington
    Replies:
    5
    Views:
    234
  5. whois1230
    Replies:
    4
    Views:
    244
  6. Jason Edwardes
    Replies:
    0
    Views:
    139
  7. EvasiveEmanual
    Replies:
    4
    Views:
    443
  8. _nobody_
    Replies:
    1
    Views:
    228
  9. Bagrov
    Replies:
    5
    Views:
    340
  10. Ghost_Dev
    Replies:
    1
    Views:
    525

Share This Page

Loading...