Bug 44589 - Monotouch.Dialog.StyledStringElement defaults to a clear background
Summary: Monotouch.Dialog.StyledStringElement defaults to a clear background
Status: RESOLVED ANSWERED
Alias: None
Product: iOS
Classification: Xamarin
Component: MonoTouch.Dialog ()
Version: XI 10.0 (iOS10)
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: Future Cycle (TBD)
Assignee: Alex Soto [MSFT]
URL:
Depends on:
Blocks:
 
Reported: 2016-09-21 18:18 UTC by abonsall
Modified: 2018-03-21 02:38 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Test Case (8.98 KB, application/zip)
2017-02-09 16:44 UTC, Alex Soto [MSFT]
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and 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 Links.

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.

Related Links:
Status:
RESOLVED ANSWERED

Description abonsall 2016-09-21 18:18:21 UTC
# Steps to reproduce
Just add a styled string element to a section

# Expected behavior
The background color should be white

# Actual behavior
The background color is clear

# Supplemental info (logs, images, videos)


# Test environment (full version information)
Comment 1 Alex Soto [MSFT] 2016-09-22 02:47:59 UTC
Hello

Before I go chasing dragons :D could you tell me some more info?

* On what version of iOS are you seeing this?
* Was this on device or simulator also which one (iPhone 5/6/iPad/etc)?
* Could you provide me your version information[1]?

Thanks a bunch!

[1]: The easiest way to get exact version information is to use the 
"Xamarin Studio" menu, "About Xamarin Studio" item, "Show Details" 
button and copy/paste the version informations (you can use the 
"Copy Information" button).
Comment 2 abonsall 2016-09-22 14:42:09 UTC
I'm seeing this on iOS 10.0.1 in both the simulator and on my physical device. I only work on iPads. All of the simulator version show the issue I described (Air, Air 2, Retina). My physical iPad is a 4th gen. My tester has an Air and he also noticed the same issue.

Here is the XS info

=== Xamarin Studio Community ===

Version 6.1 (build 5441)
Installation UUID: cebdecaf-85a6-465f-82fe-a1f342fa7b06
Runtime:
	Mono 4.6.0 (mono-4.6.0-branch/746756c) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 406000245

=== NuGet ===

Version: 3.4.3.0

=== Xamarin.Profiler ===

Not Installed

=== Apple Developer Tools ===

Xcode 8.0 (11246)
Build 8A218a

=== Xamarin.iOS ===

Version: 10.0.0.6 (Xamarin Studio Community)
Hash: 6c3fee4
Branch: xcode8
Build date: 2016-09-09 13:01:32-0400

=== Xamarin.Android ===

Version: 7.0.0.15 (Xamarin Studio Community)
Android SDK: /Users/abonsall/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		4.0.3 (API level 15)
		4.4   (API level 19)
		6.0   (API level 23)

SDK Tools Version: 24.4.1
SDK Platform Tools Version: 23.0.1
SDK Build Tools Version: 23.0.1

Java SDK: /usr
java version "1.8.0_73"
Java(TM) SE Runtime Environment (build 1.8.0_73-b02)
Java HotSpot(TM) 64-Bit Server VM (build 25.73-b02, mixed mode)

Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Xamarin Android Player ===

Not Installed

=== Xamarin.Mac ===

Version: 2.10.0.99 (Xamarin Studio Community)

=== Build Information ===

Release ID: 601005441
Git revision: 68292d1ab289911c815ddc715dd7cc29a9752f9f
Build date: 2016-09-09 04:43:23-04
Xamarin addins: ed25d008672663eeb9db55f1ccecb3c24d2fd3b2
Build lane: monodevelop-lion-cycle8

=== Operating System ===

Mac OS X 10.11.6
Darwin 10_10_5GM 15.6.0 Darwin Kernel Version 15.6.0
    Mon Aug 29 20:21:34 PDT 2016
    root:xnu-3248.60.11~1/RELEASE_X86_64 x86_64
Comment 3 abonsall 2016-09-27 14:44:38 UTC
Any update on this?
Comment 4 Sebastien Pouliot 2016-10-07 19:45:32 UTC
@Alex, please check with the above information if this can be duplicated. Thanks!
Comment 5 Alex Soto [MSFT] 2017-02-09 16:44:36 UTC
Created attachment 19776 [details]
Test Case
Comment 6 Alex Soto [MSFT] 2017-02-09 16:45:24 UTC
I can confirm this is still happening
Comment 7 abonsall 2017-05-11 16:52:31 UTC
I just updated to the latest stable version of Xamarin and XCode today. Now I can't change the background color of StyledStringElement at all. I thought this might be the appropriate place to document this.

Xcode Version 8.3 (8E162)

=== Xamarin Studio Community ===

Version 6.3 (build 863)
Installation UUID: cebdecaf-85a6-465f-82fe-a1f342fa7b06
Runtime:
	Mono 5.0.0.100 (2017-02/9667aa6) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 500000100

=== NuGet ===

Version: 3.5.0.0

=== Xamarin.Profiler ===

'/Applications/Xamarin Profiler.app' not found

=== Apple Developer Tools ===

Xcode 8.3 (12169)
Build 8E162

=== Xamarin.Mac ===

Version: 3.4.0.33 (Xamarin Studio Community)

=== Xamarin.Android ===

Version: 7.3.0.13 (Xamarin Studio Community)
Android SDK: /Users/abonsall/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		4.0.3 (API level 15)
		4.4   (API level 19)
		6.0   (API level 23)

SDK Tools Version: 24.4.1
SDK Platform Tools Version: 23.0.1
SDK Build Tools Version: 23.0.1

Java SDK: /usr
java version "1.8.0_73"
Java(TM) SE Runtime Environment (build 1.8.0_73-b02)
Java HotSpot(TM) 64-Bit Server VM (build 25.73-b02, mixed mode)

Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Xamarin.iOS ===

Version: 10.10.0.33 (Xamarin Studio Community)
Hash: 3e5ac5ff
Branch: d15-2
Build date: 2017-05-05 18:11:38-0400

=== Xamarin Inspector ===

Not Installed

=== Build Information ===

Release ID: 603000863
Git revision: a2163670efe259c85cd8f335d95b175068fbbe2a
Build date: 2017-04-03 14:33:15-04
Xamarin addins: 2045d688ea1420e0381b473360ca62a763eb7d04
Build lane: monodevelop-lion-d15-1

=== Operating System ===

Mac OS X 10.12.4
Darwin 10_10_5GM 16.5.0 Darwin Kernel Version 16.5.0
    Fri Mar  3 16:52:33 PST 2017
    root:xnu-3789.51.2~3/RELEASE_X86_64 x86_64
Comment 8 Alex Soto [MSFT] 2018-03-21 02:38:57 UTC
Hello

I have reviewed the issue and Clear color is completely expected for StyledStringElements, there are two ways to setup the background color for this element and here are the defaults:

1. cell.BackgroundColor = UITableViewCell.Appearance.BackgroundColor;
2. cell.TextLabel.BackgroundColor = UIColor.Clear;

1. Is the actual background color of the cell and it defaults to use the UITableViewCell.Appearance API, so if you want to change it for all StyledStringElements you should be setting `UITableViewCell.Appearance.BackgroundColor` to the color you want.

2. is the TextLabel background color which is set to clear.

TL;DR: This is not a bug, use `UITableViewCell.Appearance.BackgroundColor` to set the default color of all StyledStringElements.