本文實例為大家分享了Android模仿微信主界面展示的具體代碼,供大家參考,具體內(nèi)容如下
先看一下效果圖
實現(xiàn)的原理:
ViewPager+FragmentPagerAdapter
主界面可分為三部分:
這里為了布局的優(yōu)化,將top和bottom抽取出來 ,然后用include將其導入主布局,如下
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" tools:context=".MainActivity" > <include layout="@layout/top" /> <android.support.v4.view.ViewPager android:id="@+id/vp_content" android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" > </android.support.v4.view.ViewPager> <include layout="@layout/bottom" /> </LinearLayout>
當前名稱:Android仿微信主界面的實現(xiàn)方法-創(chuàng)新互聯(lián)
本文地址:http://aaarwkj.com/article24/gepce.html
成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站建設、用戶體驗、建站公司、手機網(wǎng)站建設、App設計、Google
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉載內(nèi)容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉載,或轉載時需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容