1. 程式人生 > >Android之官方導航欄之Toolbar(Toolbar+DrawerLayout+ViewPager+PagerSlidingTabStrip)

Android之官方導航欄之Toolbar(Toolbar+DrawerLayout+ViewPager+PagerSlidingTabStrip)

<RelativeLayout 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"
    tools:context="com.jredu.MainActivity" >

    <android.support.v7.widget.Toolbar
        
android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:background="?attr/colorPrimary" android:minHeight="?attr/actionBarSize" /> <android.support.v4.widget.DrawerLayout android:id="@+id/drawerLayout"
android:layout_width="match_parent" android:layout_height="match_parent" android:layout_below="@id/toolbar" > <LinearLayout android:id="@+id/main" android:layout_width="match_parent" android:layout_height="match_parent"
android:orientation="vertical" > <com.jredu.PagerSlidingTabStrip android:id="@+id/tabs" style="@style/pagerTabStype" android:layout_width="match_parent" android:layout_height="48dip" android:background="@drawable/background_tabs" /> <android.support.v4.view.ViewPager android:id="@+id/pager" android:layout_width="match_parent" android:layout_height="wrap_content" tools:context=".MainActivity" /> </LinearLayout> <LinearLayout android:id="@+id/left" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_gravity="start" android:background="#fff" android:orientation="vertical" > <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center_vertical" android:orientation="horizontal" android:paddingTop="30dp" > <ImageView android:layout_width="80dp" android:layout_height="80dp" android:src="@drawable/ic_launcher" /> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical" android:paddingLeft="20dp" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="使用者名稱" android:textSize="18sp" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="身份" android:textSize="18sp" /> </LinearLayout> </LinearLayout> </LinearLayout> </android.support.v4.widget.DrawerLayout> </RelativeLayout>

相關推薦

Android官方導航Toolbar(Toolbar+DrawerLayout+ViewPager+PagerSlidingTabStrip)

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_wid

Android官方導航ActionBar

<menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://sch

android官方導航ActionBar(三)高仿優酷首頁

<style name="Theme.Holo.Light.DarkActionBar"> <item name="windowContentOverlay">@drawable/ab_solid_shadow_holo</item>

Andorid官方導航Toobar

<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="ma

Android仿小米商城底部導航二(BottomNavigationBar、ViewPager和Fragment的聯動使用)

簡介 在前文《Android仿小米商城底部導航欄(基於BottomNavigationBar)》我們使用BottomNavigationBar控制元件模仿實現了小米商城底部導航欄效果。接下來更進一步的,我們將通過BottomNavigationBar控制元件和

Android專案導航仿微信底部導航TabLayout+ViewPager+Fragment

一、實現效果: 二、依賴jar包: compile 'com.android.support:design:24+'三、專案工程結構: 四、XML佈局 activity_main.xml佈局: <?xml version="1.0" encoding="u

Android學習BottomNavigationBar實現Android特色底部導航

Android底部導航欄的實現方式特別多,例如TabHost,TabLayout,或者TextView等,都可以實現底部導航欄的效果,但是卻沒有Google官方統一的導航欄樣式,今天講的就是Google最近新增到Material design中的底部導航欄Bot

iOS - 設置導航標題居中、標題的背景顏色

nor right rect set line cati int tail 自定義 本章實現效果: Untitled.gif 前言: 項目中很多需求是要求自定義標題欄居中的,本人最近就遇到這中需求,如果用系統自帶的titleView設置的話,不會居中,經過嘗試,

導航抖動效果

this element strong 產品 z-index get 效果圖 position str 1 <!DOCTYPE html> 2 <html lang="en"> 3 <head> 4 <meta c

微信小程序開發tab導航

pos eight 數字 this -a fun index ice ive 實現功能: 點擊不同的tab導航,篩選數據 UI: js: data:{ navbar: [‘半月維保‘, ‘季度維保‘, ‘半年維保‘,"年度維保"], //count:[0,2,3

Android6.0 原始碼修改遮蔽導航虛擬按鍵(Home和RecentAPP)/動態顯示和隱藏NavigationBar

轉載請註明出處:https://blog.csdn.net/u012932409/article/details/83063075 場景分析, 為了完全實現沉浸式效果,在進入特定的app後可以將導航欄移除,當退出app後再次將導航欄恢復。(下面將採用傳送廣播的方式來移除

selenium 瀏覽器導航的三個按鈕(back、forward、refresh)

今天這幾個方法非常簡單,就是我們能看到的瀏覽器導航欄的三個按鈕:後退、前進、重新整理 driver.back() driver.forward() driver.refresh() 不多說,上程式碼試試 # -*- co

iOS開發設定導航標題的字型大小和顏色

方法一:自定義檢視。 UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 200, 44)];

Android官方導航ActionBar(二)—— Action View、Action Provider、Navigation Tabs的詳細用法

private static class TabListener<T extends Fragment> implements ActionBar.TabListener{ private Fragment mFragment; private

Android Studio官方文件使用佈局編輯器來設計UI介面

ConstraintLayout基本介面 在今天的文章開始之前,有個忙想請大家幫一下,希望在京東、淘寶、噹噹、亞馬遜購買了我的書《Android群英傳:神兵利器》的朋友們,幫忙去網店上給個簡短的評價,舉手之勞,還是多謝大家啦~~ 更新Android Studio 2.2之後,更新了佈局設計器,同

小程式開發底部導航打電話

通過底部導航欄打電話onTabItemTap:function(options){wx.switchTab({url:'跳轉路徑'})wx.makePhoneCall({phoneNumber:'電話號碼'})}

微信小程式底部導航——tabBar

微信的開發文件裡有,很多人也寫了,自己寫一遍,加深印象罷! 在學習Android的時候,被模仿一個app的介面,實現其UI。而一般來說,總是避免不了導航欄的。 比較大眾化的,就是底部導航欄啦,而實現的方式也是非常的多,如:Fragment+ViewPage Or 來一個Ra

Android圓點導航的兩個案例(ViewPager

案例一效果:佈局檔案:<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/too

android隱藏虛擬導航-------cocos2dx 3.x

查到網上的說法 android 沉浸式狀態列, 百度百科。沉浸式就是要給使用者提供完全沉浸的體驗,使使用者有一種置身於虛擬世界之中的感覺。比如說現在大熱的VR就是主打的沉浸式體驗。 其實想實現的效果就是——————————–隱藏狀態列 一個Android應用程式的介面上其實是有很多

Android隱藏底部導航三大金剛按鈕

 注:非uid.system專案不用看了。。。。避免看完嘗試不行,233333     定製化專案難免會用到這種需求,要就隱藏底部導航欄,讓使用者不能點選,底部導航欄的3大金剛分別就是我們看到的-返回鍵、home鍵、recent鍵。返回鍵對於我們來說很簡單,平時總是要監聽重