![]()
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:background="@color/new_main_bg"
android:layout_height="match_parent">
<com.setbuy.activity.view.ViewPagerScroller
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="none">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
</LinearLayout>
</com.setbuy.activity.view.ViewPagerScroller>
<LinearLayout
android:id="@+id/ll_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:background="#FA5A3A"
android:orientation="vertical" >
<RelativeLayout
android:id="@+id/catelayout"
android:layout_width="match_parent"
android:layout_height="60dip" >
<ImageView
android:id="@+id/iv_setting"
android:layout_width="20dp"
android:layout_height="fill_parent"
android:layout_alignParentLeft="true"
android:layout_marginLeft="12dp"
android:layout_marginTop="15dp"
android:src="@mipmap/per" />
<TextView
android:id="@+id/tv_title_bar_tb"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_centerHorizontal="true"
android:layout_marginTop="25dp"
android:gravity="center"
android:text="我的"
android:textColor="@color/white"
android:textSize="16sp"
android:textStyle="bold" />
</RelativeLayout>
</LinearLayout>
</RelativeLayout>
//头标题滑动
public void initScroller(){
ll_title.getBackground().mutate().setAlpha(0);
}
@Override
public void onScroll(int scrollY) {
if (scrollY < 10) {
ll_title.getBackground().mutate().setAlpha(0);
} else {
ll_title.getBackground().mutate().setAlpha(255);
}
}