2013-09-03 2 views
1

검색 한 결과가 없습니다. 나는 여전히 열을 볼 수있는 메뉴가 필요하고 그것을 클릭하면 레이아웃의 나머지 부분을 보여주기 위해 오른쪽 또는 왼쪽으로 슬라이드됩니다. 내 활동을 넘어서는 것은 무엇일까? 도움이 되었습니까? 나는 그런 일을 찾고 있어요 : 만 jfeinstein하지만 당신은 슬쩍 때, 화면도 이동의 메뉴를 슬라이딩 발견클릭하기 전에 표시된 열이있는 슬라이딩 메뉴가 있습니까?

enter image description here

. 미리 감사드립니다.

답변

4

This이 아마도 필요한 것일 수 있습니다.

예 :

activity_main.xml :

  • app:actions_layout="@layout/actions"

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
        xmlns:app="http://schemas.android.com/apk/res-auto" 
        android:layout_width="match_parent" 
        android:layout_height="match_parent" > 
    
        <shared.ui.actionscontentview.ActionsContentView 
         android:id="@+id/content" 
         android:layout_width="match_parent" 
         android:layout_height="match_parent" 
         app:actions_layout="@layout/actions" 
         app:actions_spacing="50dp" 
         app:content_layout="@layout/content" 
         app:shadow_drawable="@drawable/shadow" 
         app:shadow_width="8dip" 
         app:spacing="64dip" 
         app:spacing_type="right_offset" /> 
    
    </RelativeLayout> 
    
    -이 당신의 왼쪽 메뉴의 레이아웃입니다. 왼쪽 메뉴는
  • app:content_layout="@layout/content" 볼 수 있습니다 얼마나 많은 의미 - - DP에서 왼쪽에서 오프셋 - 당신은
  • app:actions_spacing
  • 을 원하는이 모든 것을 넣을 수있는이 메인 컨텐츠의 레이아웃입니다. 모든 것을 넣을 수도 있습니다. 이 예를 들어 당신이 FrameLayout이있을 수 있으며 사용자가
  • app:spacing_type="right_offset"app:spacing="64dip"을 클릭 어떤 메뉴 항목을 기준으로 코드에서 조각을 첨부 할 수 있습니다 - 떠날 때 메뉴가 열려 있다는 것을 의미, 그 주요 내용이 표시됩니다 얼마나 많은

MainActivity.java :

@Override 
protected void onCreate(Bundle savedInstanceState) 
{ 
    setContentView(R.layout.activity_main); 
    mSlidingMenu = (ActionsContentView) findViewById(R.id.content); 

    //this will open menu 
    mSlidingMenu.showActions(); 

    //this will close menu 
    mSlidingMenu.showContent(); 

} 
+0

좋아하지만은 쉽게 있나요? – deadfish

+0

"쉽게"한다는 것은 무엇을 의미합니까? 이 lib는 매우 사용하기 쉽습니다. 시도 할 때 몇 가지 문제가 있었습니까? – traninho

+0

예제는 매우 복잡합니다. imho – deadfish