Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

ConformsToProtocol

$
0
0

Hi,

Could someone help me translate this into Xamarin IOS code please -

http://stackoverflow.com/questions/8583463/uisearchbar-keyboard-return-key

for(UIView *subView in searchBar.subviews) {
    if([subView conformsToProtocol:@protocol(UITextInputTraits)]) {
        [(UITextField *)subView setKeyboardAppearance: UIKeyboardAppearanceAlert];
    }
}

I have so far -

foreach (UIView subView in searchBar.Subviews)
{
    if (subView.ConformsToProtocol(?intptr? IUITextInputTraits))
    {
        ((UITextField) subView).KeyboardAppearance = UIKeyboardAppearance.Alert;
        //((UITextField) subView).ReturnKeyType = UIReturnKeyType.Done;
    }
}

But do not know how to use ConformsToProtocol

Thanks


Viewing all articles
Browse latest Browse all 204402

Trending Articles