android slidingdrawer 方向,如何使Android SlidingDrawer从左侧滑出?
我找到了一個簡單的方法來做到這一點。您所要做的就是為slidingDrawer,內(nèi)容和句柄設置180o的旋轉角度。
您可以類似地制作一個從頂部下降的SlidingDrawer,就像我做過here一樣。
看看我的例子,首先從右到左,以便能夠看到差異。
android:id="@+id/slidingDrawer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_horizontal"
android:handle="@+id/handle"
android:content="@+id/content">
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_launcher" />
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#FF0000"
android:src="@drawable/ic_launcher" />
現(xiàn)在看看我改變了什么讓它從左側滑出。android:id="@+id/slidingDrawer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_horizontal"
android:handle="@+id/handle"
android:content="@+id/content"
android:rotation="180">
android:layout_width="wrap_content"
android:layout_height="wrap_content">
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_launcher"
android:rotation="180" />
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="#FF0000"
android:src="@drawable/ic_launcher"
android:rotation="180" />
請注意,我也創(chuàng)建了一個LinearLayout來設置為句柄,并沒有改變它的旋轉,但我改變了它的子節(jié)點的旋轉。這是為了防止我有一個小問題,但一切工作正常,很簡單。總結
以上是生活随笔為你收集整理的android slidingdrawer 方向,如何使Android SlidingDrawer从左侧滑出?的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 2万字带你攻略掉Selenium
- 下一篇: python基础入门(7)之元组