我试图让滑动抽屉的手柄按钮不可见或者在我点击它时禁用它,因为我想通过另一个按钮而不是用手柄按钮来调用它
<Button
android:id="@+id/open_setting"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<SlidingDrawer
android:id="@+id/setting"
android:layout_width="100dp"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:content="@+id/content"
android:handle="@+id/handlee" >
<Button
android:id="@+id/handlee"
android:visibility="gone"
android:layout_width="wrap_content"
android:clickable="false"
android:layout_height="wrap_content"
/>
<LinearLayout
android:id="@+id/content"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="#000000"
android:orientation="vertical" >
</LinearLayout>
</SlidingDrawer>
这是我用来打开这张幻灯片的另一个按钮的代码。
Button openslide = (Button) findViewById(R.id.open_setting);
final SlidingDrawer setting = (SlidingDrawer)
findViewById(R.id.setting_Slide);
openslide.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
setting.open();
}
});