瀏覽代碼

Add ContentView after TopBar (#871)

closes #851
Guy Carmeli 8 年之前
父節點
當前提交
6319f0c649

+ 0
- 2
android/app/src/main/java/com/reactnativenavigation/react/NavigationReactGateway.java 查看文件

21
 
21
 
22
 import javax.annotation.Nullable;
22
 import javax.annotation.Nullable;
23
 
23
 
24
-//import android.view.View;
25
-
26
 public class NavigationReactGateway implements ReactGateway {
24
 public class NavigationReactGateway implements ReactGateway {
27
 
25
 
28
     private final ReactNativeHost host;
26
     private final ReactNativeHost host;

+ 6
- 1
android/app/src/main/java/com/reactnativenavigation/screens/CollapsingSingleScreen.java 查看文件

43
         contentView = new CollapsingContentView(getContext(), screenParams.screenId, screenParams.navigationParams);
43
         contentView = new CollapsingContentView(getContext(), screenParams.screenId, screenParams.navigationParams);
44
         setViewMeasurer();
44
         setViewMeasurer();
45
         setupCollapseDetection((CollapsingTopBar) topBar);
45
         setupCollapseDetection((CollapsingTopBar) topBar);
46
-        addView(contentView, createLayoutParams());
46
+        post(new Runnable() {
47
+            @Override
48
+            public void run() {
49
+                addView(contentView, createLayoutParams());
50
+            }
51
+        });
47
     }
52
     }
48
 
53
 
49
     private void setViewMeasurer() {
54
     private void setViewMeasurer() {