Ejemplo n.º 1
0
        public static IntPtr GetAppearance(IntPtr class_ptr, UITraitCollection traits)
        {
            if (traits == null)
            {
                throw new ArgumentNullException("traits");
            }

            return(Messaging.IntPtr_objc_msgSend_IntPtr(class_ptr, Selector.GetHandle(UIAppearance.selAppearanceForTraitCollection), traits.Handle));
        }
Ejemplo n.º 2
0
        // new in iOS9 but the only option for tvOS
        public static IntPtr GetAppearance(IntPtr class_ptr, UITraitCollection traits, params Type [] whenFoundIn)
        {
            if (traits == null)
            {
                throw new ArgumentNullException("traits");
            }

            using (var array = NSArray.FromIntPtrs(TypesToPointers(whenFoundIn))) {
                return(Messaging.IntPtr_objc_msgSend_IntPtr_IntPtr(class_ptr,
                                                                   Selector.GetHandle(UIAppearance.selAppearanceForTraitCollectionWhenContainedInInstancesOfClasses),
                                                                   traits.Handle, array.Handle));
            }
        }
Ejemplo n.º 3
0
 public static UIFont GetPreferredFontForTextStyle(UIFontTextStyle uiFontTextStyle, UITraitCollection traitCollection)
 {
     return(GetPreferredFontForTextStyle(uiFontTextStyle.GetConstant(), traitCollection));
 }
Ejemplo n.º 4
0
        public static UIFont GetPreferredFontForTextStyle(NSString uiFontTextStyle, UITraitCollection traitCollection)
        {
            var ptr = _GetPreferredFontForTextStyle(uiFontTextStyle, traitCollection);

            return(ptr == IntPtr.Zero ? null : new UIFont(ptr));
        }