Bug 21221 - UIScrollView appearance proxy is empty
Summary: UIScrollView appearance proxy is empty
Status: NEW
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll (show other bugs)
Version: 7.2.5
Hardware: PC Windows
: Normal enhancement
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-07-10 05:15 UTC by Nathan Randle
Modified: 2014-07-15 12:33 UTC (History)
3 users (show)

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


Attachments

Description Nathan Randle 2014-07-10 05:15:07 UTC
It doesn't appear to be possible to set UIScrollView appearance properties using UIScrollview.Appearance.

UIScrollViewAppearance inherits from UIViewAppearance without adding any scroll view sepcific properties.

In particular the indicator style is something I would like to set globally but am unable to without the appearance proxy implementation.
Comment 1 Sadik Ali 2014-07-10 10:32:08 UTC
I can reproduce the reported behavior. I am also not able to set the value of "UIScrollview.Appearance" property. 

I have checked the definition of "UIScrollview" class in assembly browser and I observed that the "Appearance" property only contain get accessor and doesn't contain set accessor. So it's only read only property. I have also checked the definition of "Appearance" property in "UIView" class and it's also not contain the set accessor.

Screencast: http://www.screencast.com/t/5AKO6by06

I’ll need confirmation from the developer if this is a bug. Leaving as NEW for now.
Comment 2 Nathan Randle 2014-07-10 11:49:10 UTC
No UIScrollView.Appearance should not be settable. 

It should return an appearance proxy which allows you to set global styles for controls. In this case the properties I'm interested in aren't present on the appearance proxy.
Comment 3 Rolf Bjarne Kvinge [MSFT] 2014-07-15 12:33:50 UTC
It doesn't look like Apple documents any of the UIScrollView properties with UI_APPEARANCE_SELECTOR, so you'd be heading into undocumented territory here.

You can however probably work around it by manually calling the selector:

using MonoTouch.ObjCRuntime;

Messaging.objc_msgSend_int (uiScrollView.Appearance.Handle, Selector.GetHandle ("setIndicatorStyle:"), myIndicatorStyle);

Note You need to log in before you can comment on or make changes to this bug.