android


Android border on a button difference between 4.4 and 4.0.3


I have an activity with a coloured background and a button which is the same colour which I want to minimally show with a white outline.
I used this answer to make a border on a button and it works just fine for me on Nexus 4 and 5 running 4.4.4
I try it on a Samsung S2 running 4.0.3 and the entire button turns black. No border. The button should be same colour as the activity with a white border. Text colour on the button (white) is just fine
Here is my border.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<corners android:radius="3dp" />
<stroke
android:width="1px"
android:color="#ffffff" />
</shape>
Can anyone explain the different behaviour, and more importantly tell me how to fix it?
Thanks
Edit
Well I don't have a real answer, but I think I'm going to fix it by adding in
<solid android:color="#color/mycolor" />
To my drawable shape. I think this works, but it's not very elegant if I want to have a transparent background. I may try setting the color to transparent at some point (on the assumption that some phones/versions of Android default to a black background and this is that easy to change), but no time for it now.

Related Links

Google Map Implementation in Viewpager, Error Unable to get provider com.google.firebase.provider.FirebaseInitProvider
set Hindi as TextToSpeech language in android programatically
How to make a link redirecting on Apple store or Google play
How to rotate image slowly in android?
Find element by class-name and content-desc in web context selenium
Retrofit - Failure in SSL library, usually a protocol error
Redirect site page on Intel XDK
How to implement own cast.receiver.media.Player
Titanium View.toImage() and base64 encode not always decoding properly
How does Firebase crash reporting initialize
AVD errors with HAX on Android Studio 2.1
Slider and ngModel lagging with finger slide
How to set proper version control for Ionic project
Android Studio Gradle task stuck
Android file access questions
GLSL 2.0 Shader giving different light in different device

Categories

HOME
asp.net-web-api
google-app-engine
oracle12c
delphi-7
deep-learning
time-complexity
string
codenvy
yahoo-finance
jelastic
gradient
owl-carousel
google-cloud-functions
yandex
visual-studio-emulator
babeljs
opengl-3
accessibility
vimdiff
ibeacon-android
heap
distribution
emoji
xcodebuild
package.json
visual-glitch
jquery-ias
pimcore
easeljs
highstock
ckfinder
soot
panoramas
utorrent
record
html-encode
slacktextviewcontroller
yowsup
getlasterror
numpy-broadcasting
video-capture
sim-toolkit
watchman
print-css
claims
avcapturedevice
photos
memory-mapping
opencmis
getchar
ovf
globalize
aquamacs
amq
backbone-collections
jqchart
cmp
javafx-css
choice
smartfoxserver
slackware
cudd
pure-css
meteor-packages
google-cloud-console
tinkerpop3
x-tag
lua-telegram-bot
riot
bizagi
database-relations
piracy-prevention
mobiledoc-kit
jaunt-api
ascii-art
sapi
oracle-spatial
dock
sony-lifelog-api
teamcity-9.1
git-ftp
mraid
osc
fits
shopizer
code-documentation
public-html
adehabitathr
infosphere-spl
pseudo-class
mintty
reflector
alternate
terminate
vbe
isqlquery
route-provider
facebook-timeline
font-awesome-4.0.0
dopostback
redis-py
extreme-programming
fitbounds
infobright
urlrewriter
node-redis
mysql-error-1205
google-ajax-api
w3c-geolocation
appledoc
commerceserver2007
delimited-text
sun
application-planning

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App