Android:SlidingPaneLayout自动打开,如果没有用户操作,则无法以编程方式关闭

时间:2019-05-02 17:55:31

标签: android slidingpanelayout

当我打开具有SlidingPaneLayout的选项卡片段时,默认情况下将自动打开窗格。我想默认隐藏它。 该视频在https://www.youtube.com/watch?v=_9XjgVCqIOg&t=31

中解释了错误

在onViewCreated中,我尝试添加slidePaneLayout.openPane();。 &slidePaneLayout.closePane();但没有任何效果。 https://github.com/onedrupal/One-Drupal-Android/blob/master/app/src/main/java/com/technikh/onedrupal/fragments/FragmentADRedsox.java#L234

https://github.com/onedrupal/One-Drupal-Android/blob/master/app/src/main/res/layout/fragment_ad_redsox.xml#L79

<androidx.slidingpanelayout.widget.SlidingPaneLayout>

https://github.com/onedrupal/One-Drupal-Android/blob/master/app/src/main/res/layout/fragment_ad_redsox.xml#L128

<LinearLayout
            android:id="@+id/llRightMenu"

请注意,从API提取数据后,会动态添加SlidingPaneLayout中的内容

https://github.com/onedrupal/One-Drupal-Android/blob/a0bfe8fef7b575d69b711fa754b52792a4073a69/app/src/main/java/com/technikh/onedrupal/fragments/FragmentADRedsox.java#L398

AndroidTreeView tView = new AndroidTreeView(context, root2);
llRightMenu.addView(tView.getView());

0 个答案:

没有答案