我對裝配兩個自定義視圖一起工作真的很惱人的問題。我試圖在Android活動中顯示這兩個視圖,但其中一個需要整個活動的可視空間,另一個放在它的下面。第一個視圖只使用了一小部分空間,其餘部分是透明的,但只有當它的寬度和高度爲match_parent
時才起作用,因此另一個視圖顯示在其下,但它不能接收任何觸摸事件。這裏是他們的樣子:底部視圖被頂視圖擋住了
XML代碼:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/background_app" >
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<com.fortysevendeg.android.swipelistview.SwipeListView
xmlns:swipe="http://schemas.android.com/apk/res-auto"
android:id="@+id/example_lv_list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:listSelector="#00000000"
swipe:swipeActionLeft="dismiss"
swipe:swipeBackView="@+id/back"
swipe:swipeCloseAllItemsWhenMoveList="true"
swipe:swipeFrontView="@+id/front"
swipe:swipeMode="both"
android:focusableInTouchMode="true"/>
</LinearLayout>
<com.touchmenotapps.widget.radialmenu.semicircularmenu.SemiCircularRadialMenu
android:id="@+id/radial_menu"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="bottom"
android:padding="1dip" />
</FrameLayout>
我想要做的是能觸及底部,其中頂部視圖是透明的,並且能夠觸摸不透明的頂視圖。我嘗試以不同的方式安排xml,但它不斷崩潰,這是它工作的唯一方式,但出現了這個問題。
鏈接到自定義瀏覽:
- 徑向菜單,窗口小部件:github.com/strider2023/Radial-Menu-Widget-Android
- SwipeListView庫:github.com/47deg/android-swipelistview
- SwipeListView樣本:github.com/47deg/android-swipelistview-sample
我想在這裏實現類似於Catch Notes應用的東西。如果還有其他的方式,或者你可以建議的其他圖書館,這將是非常感謝。