Style React Native Android Native module using Java

24 Views Asked by At

I'm working on Android native module, and I'm trying to add padding to the view from Java code, what is happening is that the child view is not pushed when I'm using setPadding method, any idea why?

public class TestView extends ReactViewGroup {
  public TestView(Context context) {
    super(context);

    this.setPadding(100,100,100,100);
}

}

When I'm passing it from JS like below, all is good, the only issue is with setting it from Java code

<TestView style={{padding:100}}><View style={{flex:1}}/></TestView> 
0

There are 0 best solutions below