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

showDatePickerDialog can't load DatePicker Dialog
Permission issues while trying to compile native code
sherlock SearchView always collapsed
How to pass data between activities
Add a LinearLayout in bundle
Android start system service at app startup
add animation to listview items
Android Disable airplane mode at version >=4.1
Android: Adding many children to a layout in a separate thread
Robotium with parameter
Android navigating to parent Fragment Activity from within Fragments
How to query rows in between two datetime columns?
App crashes when receiving of message
How to make layout have the same height?
Could we use a library project as a jar file?
ADB shows unknown device

Categories

HOME
string
phpmyadmin
nunit
sitecore
error-handling
database-normalization
onclick
tvos
python-multithreading
accessibility
augeas
enthought
android-securityexception
siddhi
rtf
libc
code-generation
coin3d
keytool
atlassian-stash
dreamweaver
google-picker
sse
php-mysqlidb
exit
flask-sqlalchemy
jquery-callback
dapper-extensions
expressionengine3
pic32
corpus
linked-data
errbot
browser-sync
sqlpackage
paragraph
jbutton
git-squash
installshield-le
magento-1.9.2.4
filesystemwatcher
unordered-map
comparison-operators
ogc
linqpad
print-css
file-sharing
httr
getchar
check-mk
cpu-cache
jtree
android-instrumentation
parfor
dimension
jtwig
lua-telegram-bot
data-protection
thread-sleep
ascii-art
wiredep
vigenere
sony-lifelog-api
baasbox
jsvc
ansi
bufferedinputstream
boost-program-options
machine-instruction
nsmenu
jquery-slider
fpdi
square-bracket
neos-server
flex++
process-explorer
wp7test
http-status-code-410
android-loadermanager
nokia-s40
monotouch.dialog
sentestingkit
subproject
appjs
multiplexing
urlrewriter
screen-size
lr
django-paypal
qtabbar
interop-domino
fault-tolerance
sqlobject
cardspace
appliance

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