2013-01-17 51 views
-1

我想要一个片段从右侧出现,每当我得到一个onListItemClick事件,就像滑动菜单一样。假设我已经实现了这个片段;我怎样才能让它出现?我似乎无法弄清楚。感谢您的时间。我怎样才能动态添加一个片段

编辑: 这是一个ViewGroup这里我想补充的片段:

<TabHost 
    android:id="@android:id/tabhost" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" > 

    <LinearLayout 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:orientation="vertical" > 

     <TabWidget 
      android:id="@android:id/tabs" 
      android:layout_width="fill_parent" 
      android:layout_height="match_parent" 
      android:orientation="horizontal" /> 


      <FrameLayout 
       android:id="@android:id/tabcontent" 
       android:layout_width="0dp" 
       android:layout_height="0dp" /> 

      <android.support.v4.view.ViewPager 
       android:id="@+id/tabviewpager" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_marginBottom="16dp" 
       android:layout_marginLeft="16dp" 
       android:layout_marginRight="16dp" 
       android:layout_marginTop="16dp" > 

      </android.support.v4.view.ViewPager> 
    </LinearLayout> 

</TabHost> 

的TabViewPager是我加我的片段,当活动被实例化,ans是我需要动态添加我的新Fragment的地方。

回答

0

这是库:

https://github.com/jfeinstein10/SlidingMenu

您可以从许多方面推动SlidingMenu,我想你需要先和背部尽量在这里,当你在一个错误卡住了,然后I'll是很高兴帮助你。

+0

yes..Maybe我不clear.I不想使用SlidingMenu API我有创建一个具有特定用户界面的片段,我希望它出现像slidingmenu(我的片段实现不slidingMenu)。它是关于添加一个片段的布局,但我似乎无法找到如何正确添加它,这就是为什么我询问 – Libathos

+0

如果你想出现像,为什么你不使用SlidingMenu? – Marckaraujo

+0

,因为这只是一个菜单我有一些textViews和其他东西的片段,不需要切换到SlidingMenu我只需要如何将其添加在我的layout.IF你可以帮助我,我会很感激 – Libathos