課程
/移動開發(fā)
/Android
/QQ5.0側(cè)滑菜單
ScrollView右邊可以放ViewPager嗎?我想做一個左邊是菜單欄 ?然后右邊內(nèi)容區(qū)域放一個類似微信界面可以來回滑動的ViewPager
2015-06-13
源自:QQ5.0側(cè)滑菜單
正在回答
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
? ? xmlns:ling="http://schemas.android.com/apk/res/com.ling.sportandmusic"
? ? android:layout_width="match_parent"
? ? android:layout_height="match_parent"
? ? android:orientation="vertical" >
? ??
? ? ? <com.ling.view.MyScrollView?
? ? ? ? android:id="@+id/my_scrollview"
? ? ? ? android:layout_width="match_parent"
? ? ? ? android:layout_height="match_parent"
? ? ? ? ling:mMenuRightPadding="80dp">
? ? ? ? <LinearLayout?
? ? ? ? ? ? android:layout_width="match_parent"
? ? ? ? ? ? android:layout_height="match_parent">
? ? ? ? ? ? <include layout="@layout/left_menu"/>
? ? ? ? ? ? <include layout="@layout/right_content2"/>
? ? ? ? </LinearLayout>
? ? ? ??
? ? </com.ling.view.MyScrollView>
</LinearLayout>
這是我第一個fragment的布局代碼
多試了幾次 ?有的時候可以從第一個fragment滑到后面的fragment去 ?但是再滑回到第一個fragment時第一個fragment菜單欄始終是展開的再往左滑菜單欄不會收回去而是跳到后面的fragment去。。不知道是不是因為這個滑動起了沖突的問題啊
我試了下 ?主界面是一個viewPager ? 在viewPager中放三個fragment在第一個fragment(也就是滑到最左邊的fragment)布局中加入自己定義的scrollview????????大概想法就是當滑到第一個fragment時再往右滑菜單欄就會展開再往左滑菜單欄關(guān)閉 ?如果繼續(xù)往左滑則相應(yīng)的滑到第二個fragment,第三個fragment ?不過好像只顯示了第一個fragment,往右滑菜單欄會展開但是在第一個fragment中往左滑卻滑不動。。
舉報
本教程將帶領(lǐng)大家通過自定義控件實現(xiàn)QQ5.0側(cè)滑菜單
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網(wǎng)安備11010802030151號
購課補貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號
2015-06-13
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
? ? xmlns:ling="http://schemas.android.com/apk/res/com.ling.sportandmusic"
? ? android:layout_width="match_parent"
? ? android:layout_height="match_parent"
? ? android:orientation="vertical" >
? ??
? ? ? <com.ling.view.MyScrollView?
? ? ? ? android:id="@+id/my_scrollview"
? ? ? ? android:layout_width="match_parent"
? ? ? ? android:layout_height="match_parent"
? ? ? ? ling:mMenuRightPadding="80dp">
? ? ? ? <LinearLayout?
? ? ? ? ? ? android:layout_width="match_parent"
? ? ? ? ? ? android:layout_height="match_parent">
? ? ? ? ? ? <include layout="@layout/left_menu"/>
? ? ? ? ? ? <include layout="@layout/right_content2"/>
? ? ? ? </LinearLayout>
? ? ? ??
? ? </com.ling.view.MyScrollView>
</LinearLayout>
這是我第一個fragment的布局代碼
2015-06-13
多試了幾次 ?有的時候可以從第一個fragment滑到后面的fragment去 ?但是再滑回到第一個fragment時第一個fragment菜單欄始終是展開的再往左滑菜單欄不會收回去而是跳到后面的fragment去。。不知道是不是因為這個滑動起了沖突的問題啊
2015-06-13
我試了下 ?主界面是一個viewPager ? 在viewPager中放三個fragment在第一個fragment(也就是滑到最左邊的fragment)布局中加入自己定義的scrollview????????大概想法就是當滑到第一個fragment時再往右滑菜單欄就會展開再往左滑菜單欄關(guān)閉 ?如果繼續(xù)往左滑則相應(yīng)的滑到第二個fragment,第三個fragment ?不過好像只顯示了第一個fragment,往右滑菜單欄會展開但是在第一個fragment中往左滑卻滑不動。。