2014-12-22 2 views
2

프로젝트에서이 레이아웃을 구현해야합니다. 슬라이딩 서랍 대신 나를 위해 잘 작동합니다. com.coboltforge.slidemenuexample의 slidemenu.xml을 사용자 정의하면 작동이 멈 춥니 다. 액션 모음에서 액션 버튼을 클릭하여 서랍을 설정하면 열린 상태로 유지됩니다. & 닫히지 않습니다. 내가 원하는 것은 "imageView1의 onClick 이벤트에서 조각이없는 다른 활동 열기"입니다. 나는 이것을 어떻게하는지 모른다. 어떤 도움을 주시면 감사하겠습니다.안드로이드에서 com.coboltforge.slidemenuexample 라이브러리를 사용자 정의하는 방법은 무엇입니까?

<LinearLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:orientation="vertical" > 

    <View 
     android:layout_width="250dp" 
     android:layout_height="1dp" 
     android:background="#a8a8a8" /> 

    <RelativeLayout 
     android:layout_width="250dp" 
     android:layout_height="48dp" 
     android:paddingRight="15dp" 
     android:paddingLeft="20dp" 
     android:background="#000000" > 

     <TextView 
      android:id="@+id/textView1" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:textAppearance="?android:attr/textAppearanceLarge" 
      android:layout_centerVertical="true" 
      android:textStyle="bold" 
      android:textColor="#ffffff" 
      android:text="Demo Mode" /> 

     <View 
      android:layout_width="1dp" 
      android:layout_height="fill_parent" 
      android:layout_marginLeft="20dp" 
      android:layout_toLeftOf="@+id/imageView1" 
      android:background="#a8a8a8" /> 

     <ImageView 
      android:id="@+id/imageView1" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_alignParentRight="true" 
      android:layout_centerVertical="true" 
      android:src="@drawable/settings_icon" 
      android:layout_marginLeft="15dp" 
      android:contentDescription="@null" /> 

    </RelativeLayout> 

    <View 
     android:layout_width="250dp" 
     android:layout_height="1dp" 
     android:background="#a8a8a8" /> 

    <View 
     android:layout_width="250dp" 
     android:layout_height="20dp" 
     android:background="#000000" /> 

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

     <ListView 
      android:id="@+id/menu_listview" 
      android:layout_width="fill_parent" 
      android:layout_height="match_parent"    
      android:divider="@android:color/darker_gray"    
      android:dividerHeight="1dip" 
      android:background="#000000" /> 

    </LinearLayout> 

    <FrameLayout 
     android:id="@+id/overlay"   
     android:layout_width="match_parent" 
     android:layout_height="match_parent" > 
    </FrameLayout> 

</LinearLayout> 

답변

0

은 단순히 (활동을 열 메소드를 호출하기)를 클릭하고 onclick을 첨부 나를 위해 원활 일 자사의 XML 레이아웃 &에 이미지 뷰에 속성했다. 이전에 자바 파일 &에서 onClickListener를 첨부 해 보았습니다.

<ImageView 
       android:id="@+id/imageView1" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_alignParentRight="true" 
       android:layout_centerVertical="true" 
       android:src="@drawable/settings_icon" 
       android:layout_marginLeft="15dp" 
       android:clickable="true" 
       android:onClick="openSettingsIconActivity" 
       android:contentDescription="@null" /> 
관련 문제