結構検索する人はいるみたいで、
Googleの候補にも出てくるんですが、
海外サイトのソースまで見る人は少なく、
日本語サイトは無かったので解説していきます。
今回の参照先は下記になります。
Widget: SlidingDrawer top to bottom
まず、下の方にある、Demo用のサンプルソースをGetします。
SlidingDrawer Demo
ってところです。
あとはDemoに沿っていけばだいたい出来ます。
と言わず、まず
res/values/multi__attrs.xml
を自分のプロジェクトに配置します。
次に、
it.sephiroth.demo.slider.widget.MultiDirectionSlidingDrawer.java
をプロジェクトへ配置します。
あとは、Layout内で、ブログでも解説しているように書いてください。
注意点はパッケージ名指定部分と、
my:direction/my:handle/my:content
の指定部分をしっかりしておくことです。
ここが出来てないとエラーが起こりますのでご注意を
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<View class="it.sephiroth.demo.slider.widget.MultiDirectionSlidingDrawer"
xmlns:my="http://schemas.android.com/apk/res/パッケージ名"
android:id="@+id/drawer"
my:direction="topToBottom"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
my:handle="@+id/handle"
my:content="@+id/content">
<include android:id="@id/content"
layout="@layout/pen_content" />
<ImageView android:id="@id/handle"
android:layout_width="wrap_content"
android:layout_height="40px"
android:src="@drawable/sliding_drawer_handle_bottom" />
</View>
</RelativeLayout>
では次回もよろしくお願いします。
0 件のコメント:
コメントを投稿