Browse Source

Apply topMargin only if defined

Guy Carmeli 6 years ago
parent
commit
93a448fe95

+ 1
- 1
lib/android/app/src/main/java/com/reactnativenavigation/presentation/OptionsPresenter.java View File

@@ -62,7 +62,7 @@ public class OptionsPresenter {
62 62
     }
63 63
 
64 64
     private void applyTopMargin(View view, Options options) {
65
-        if (view.getLayoutParams() instanceof MarginLayoutParams) {
65
+        if (view.getLayoutParams() instanceof MarginLayoutParams && options.layout.topMargin.hasValue()) {
66 66
             ((MarginLayoutParams) view.getLayoutParams()).topMargin = options.layout.topMargin.get(0);
67 67
         }
68 68
     }