Skip to content

UISearchBar cannot display #1270

@bolasblack

Description

@bolasblack

My Obj-C Code:

    #import <UIKit/UIKit.h>
    #import "RCTViewManager.h"

    @interface RCTSearchBarTest : RCTViewManager
    @end

    @implementation RCTSearchBarTest

    RCT_EXPORT_MODULE()

    - (UISearchBar *)view
    {
      return [[UISearchBar alloc] init];
    }

    @end

My js code:

    var {requireNativeComponent} = React;
    var RCTSearchBarTest = requireNativeComponent('RCTSearchBarTest', null);
    var App = React.createClass({
      render: function() {
        <View>
          <RCTSearchBarTest />
        </View>
      }
    })

I learned it from React-Native's document: https://facebook.github.io/react-native/docs/nativecomponentsios.html

I tried Reveal, the UISearchBar is exist, but not displayed.

After I add code [searchBar setFrame:CGRectMake(0, 0, 375, 44)];, it works, but I lookup from React-Native's code I didn't found anything like this.

Actual code: CoffeeScript, Objective-C

Is anything I missed?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions