Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
Created attachment 14370 [details]
When the Android App Project's MainActivity inherits from FormsAppCompatActivity then setting a Button's border does not get rendered. The same Forms button with the same settings renders correctly when MainActivity inherits from FormsApplicationActivity.
## Steps to reproduce
1. Open the attached test project.
2. Run the app to simulator or device.
Expected result: Button should have thick red border around it.
Actual result: Border settings are ignored and button has no border.
If you open MainActivity.cs in the Android app project and change the class's inheritance to FormsApplicationActivity and remove the AppCompat specific theme (comment out line 14) then the Button's border is rendered as expected.
Forms version 188.8.131.5290
=== Xamarin Studio ===
Version 5.10.1 (build 6)
Installation UUID: 964c531b-d928-456b-a9ae-e1f82266b360
Mono 4.2.1 (explicit/6dd2d0d)
GTK+ 2.24.23 (Raleigh theme)
Package version: 402010102
=== Xamarin.Profiler ===
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler
=== Xamarin.Android ===
Version: 184.108.40.206 (Business Edition)
Android SDK: /Users/apple/Library/Developer/Xamarin/android-sdk-mac_x86
Supported Android versions:
4.0.3 (API level 15)
4.1 (API level 16)
4.2 (API level 17)
4.3 (API level 18)
4.4 (API level 19)
5.0 (API level 21)
5.1 (API level 22)
6.0 (API level 23)
SDK Tools Version: 24.4.1
SDK Platform Tools Version: 23.1
SDK Build Tools Version: 23.0.2
Java SDK: /usr
java version "1.7.0_79"
Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)
=== Xamarin Android Player ===
Location: /Applications/Xamarin Android Player.app
=== Apple Developer Tools ===
Xcode 7.2 (9548)
=== Xamarin.iOS ===
Version: 220.127.116.11 (Business Edition)
Build date: 2015-12-08 16:20:29-0500
=== Xamarin.Mac ===
Version: 18.104.22.168 (Business Edition)
=== Xamarin Inspector ===
Build date: Tue Nov 17 20:54:30 UTC 2015
=== Build Information ===
Release ID: 510010006
Git revision: 0b60eecdb531933734519c13257d16a780274aab
Build date: 2015-12-04 20:28:20-05
Xamarin addins: 9876fd7c9837977178411ec7375b4352c0a0d6af
Build lane: monodevelop-lion-cycle6-baseline
=== Operating System ===
Mac OS X 10.11.2
Darwin Jons-iMac.local 15.2.0 Darwin Kernel Version 15.2.0
Fri Nov 13 19:56:56 PST 2015
I can use a renderer to create a border for the Xamarin Forms Button Control on Android with the FormsAppCompatActivity.
Should work without a renderer.
This has to do with how material design works. Given the design guidelines, elements are naturally structured based on z-indexes and shadowing opposed to distinct borders. If a border on a button is needed, it is possible create a drawable:
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<solid android:color="#ffffff" />
<stroke android:width="2dp" android:color="#ff0000"></stroke>