문제

Though 4.3 users of iOS devices are rare these days, do we need to check before we assign values to the various Appearance classes using MonoTouch 5.2.x or will the MonoTouch framework just gracefully ignore these settings?

도움이 되었습니까?

해결책

MonoTouch (just like Objective-C) does not does version checking inside API. That would be very costly to do and, in many cases, it cannot be done reliably (e.g. a new PushSomething methods).

Even when it could be possible to ignore at runtime, e.g. types that conforms to UIAppearance protocol, the application might want to adjust itself differently if it's not supported (e.g. color choice). E.g.

if (UIDevice.CurrentDevice.CheckSystemVersion (5,0)) {
    UISlider.Appearance.BackgroundColor = UIColor.Black;
} else {
    // limited UI customization path
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top