Skip to content

Commit 93a448f

Browse files
committed
Apply topMargin only if defined
1 parent 319d9c8 commit 93a448f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/android/app/src/main/java/com/reactnativenavigation/presentation/OptionsPresenter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ private void applyViewOptions(View view, Options options) {
6262
}
6363

6464
private void applyTopMargin(View view, Options options) {
65-
if (view.getLayoutParams() instanceof MarginLayoutParams) {
65+
if (view.getLayoutParams() instanceof MarginLayoutParams && options.layout.topMargin.hasValue()) {
6666
((MarginLayoutParams) view.getLayoutParams()).topMargin = options.layout.topMargin.get(0);
6767
}
6868
}

0 commit comments

Comments
 (0)