Android Question Button borders partially disappear

Filip Van Wynsberghe

Licensed User
Longtime User
I have an application with a number of buttons. The layout of the buttons is set in the code to be:

    Private cdBtnBackground As ColorDrawable
    Private intColorBack        As Int
    Private intColorBorder      As Int
    Private intColorText         As Int
    Private intBtnTextSize      As Int

    intColorBack      = Colors.RGB(255,255,255)
    intColorBorder    = Colors.RGB(25,25,112)
    intColorText       = Colors.RGB(25,25,112)
    intBtnTextSize    = 14

    cdBtnBackground.Initialize2(intColorBack, 5, 1, intColorBorder)

    btnBest.Background             = cdBtnBackground
    btnBest.TextColor                = intColorText
    btnBest.TextSize                = intBtnTextSize

so far so good (see attached picture 1). However, while using the application, buttoms start to loose the right edge without any reason (see picture 2). After a while, all buttons lost the right edge (see picture 3)...

Is this a bug? Any suggestion what i can do to avoid this?


  • buttons1.png
    10.2 KB · Views: 162
  • buttons2.png
    10 KB · Views: 164
  • buttons3.png
    9.5 KB · Views: 141
Last edited:

Filip Van Wynsberghe

Licensed User
Longtime User
Thanks for the hints.
1. I adapted the buttons layout in the designer, and thus no longer set the drawable in the code. As a result I don't have the problem any more :);
2. I did indeed use a single drawable for multiple buttons, which I'll retain for the future. However, I don't understand why I shouldn't...
Upvote 0