Android 控件的学习

CoordinatorLayout、AppBarLayout、CollapsingToolbarLayout   

<android.support.design.widget.CoordinatorLayout
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">


<android.support.design.widget.AppBarLayout
android:id="@+id/shanghai_app_barlayot"
android:layout_width="match_parent"
android:layout_height="wrap_content">

<android.support.design.widget.CollapsingToolbarLayout
app:contentScrim="@color/colorPrimaryDark"
app:layout_scrollFlags="scroll|snap|enterAlways|exitUntilCollapsed"
android:id="@+id/shanghai_collapsingtoolbarlayout"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
app:layout_collapseMode="parallax"
app:layout_collapseParallaxMultiplier="0.6"
android:scaleType="centerCrop" ------------->图片布满全屏
android:src="@mipmap/shanghai"
android:layout_width="match_parent"
android:layout_height="200dp" />

<android.support.v7.widget.Toolbar
app:contentInsetStart="0dp"
app:layout_collapseMode="pin"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize">

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:visibility="gone"
android:background="@drawable/shape_splash"
android:id="@+id/tv_shanghai_welcome"
android:textColor="@color/color_ffffff"
android:layout_centerInParent="true"
android:gravity="center"
android:text="今日播报"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content" />

<com.news.today.todayinformation.main.shanghai.view.MarqueeTextView
android:visibility="gone"
android:id="@+id/tv_marquee_title"
android:focusable="true"
android:focusableInTouchMode="true"
android:marqueeRepeatLimit="marquee_forever"
android:text="目前播放的歌曲:天空"
android:ellipsize="marquee"
android:singleLine="true"
android:textSize="15dp"
android:textColor="@color/color_ffffff"
android:layout_marginLeft="10dp"
android:layout_centerVertical="true"
android:layout_toRightOf="@+id/tv_shanghai_welcome"
android:layout_width="100dp"
       android:layout_height="wrap_content" />
        </RelativeLayout>
        </android.support.v7.widget.Toolbar>
       </android.support.design.widget.CollapsingToolbarLayout>
       </android.support.design.widget.AppBarLayout>
       <android.support.v7.widget.RecyclerView
        app:layout_behavior="@string/appbar_scrolling_view_behavior"
        android:id="@+id/shanghai_recyclerview"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
      </android.support.v7.widget.RecyclerView>
      </android.support.design.widget.CoordinatorLayout>

posted on 2019-09-03 17:16  zhang11111wei  阅读(142)  评论(0编辑  收藏  举报

导航