Searchbar - error does not support passing non-finite values

zasah16zasah16 ZAMember ✭✭

Hi,

When I use the Searchbar with a grid on the same page I get the error below. It works on Android but not on IOS. I can work around it by setting a Widthrequest but then the component will not expand with bigger screen sizes.

Does anyone have any idea why this happens?

Thanks,
Kevin


<Grid.RowDefinitions>

        <RowDefinition Height="*"/>
    </Grid.RowDefinitions>

        <StackLayout
        Orientation="Horizontal" 
        Grid.Row="0"
        BackgroundColor="White"
        Padding="0,0,0,0"
        >
        <SearchBar BackgroundColor="LightGray" HorizontalOptions="StartAndExpand"  Placeholder="Search..." TextChanged="SearchBar_OnTextChanged" ></SearchBar>
        </StackLayout>

2017-11-02 12:57:35.597 MessengerApp2.iOS[6010:221500] *** Assertion failure in -[UISearchBar sizeThatFits:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3698.16.15/UISearchBar.m:1609
Unhandled Exception:

Foundation.MonoTouchException: Objective-C exception thrown. Name: NSInternalInconsistencyException Reason: -[UISearchBar sizeThatFits:] does not support passing non-finite values ({inf, 56})
Native stack trace:
0 CoreFoundation 0x00000001035e31cb __exceptionPreprocess + 171
1 libobjc.A.dylib 0x0000000110c80f41 objc_exception_throw + 48
2 CoreFoundation 0x00000001035e8362 +[NSException raise:format:arguments:] + 98
3 Foundation 0x000000010420e089 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 193
4 UIKit 0x00000001079f8c25 -[UISearchBar sizeThatFits:] + 347
5 MessengerApp2.iOS 0x0000000102f44e29 xamarin_dyn_objc_msgSend + 217
6 ??? 0x0000000131123c60 0x0 + 5118245984
7 ??? 0x00000001312764a2 0x0 + 5119632546

Tagged:

Posts

Sign In or Register to comment.