My Obj-C Code:
#import<UIKit/UIKit.h>
#import"RCTViewManager.h"@interfaceRCTSearchBarTest : RCTViewManager@end@implementationRCTSearchBarTestRCT_EXPORT_MODULE()
- (UISearchBar *)view
{
return [[UISearchBar alloc] init];
}
@endMy js code:
var{requireNativeComponent}=React;varRCTSearchBarTest=requireNativeComponent('RCTSearchBarTest',null);varApp=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?
My Obj-C Code:
My js code:
I learned it from React-Native's document: https://facebook.github.io/react-native/docs/nativecomponentsios.html
I tried Reveal, the
UISearchBaris 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?