我正在开发一款Android应用,目前它由多个活动组成,每个活动都有一个自定义的 LinearLayout 标题栏位于顶部。
当我切换活动时,默认动画会导致整个页面滑动,而我希望标题栏保持静态。由于标题栏在多个页面中通常包含相同的文本,因此动画似乎是不必要的。
Spotify的Android应用程序是我想表达的完美例子。如果您导航到'More'并单击'Settings',则页面内容会滑动,但标题栏不会。
如果有人有任何见解,将不胜感激! 标题栏布局:
当我切换活动时,默认动画会导致整个页面滑动,而我希望标题栏保持静态。由于标题栏在多个页面中通常包含相同的文本,因此动画似乎是不必要的。
Spotify的Android应用程序是我想表达的完美例子。如果您导航到'More'并单击'Settings',则页面内容会滑动,但标题栏不会。
如果有人有任何见解,将不胜感激! 标题栏布局:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="35dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:background="@layout/bg_menubar"
android:paddingLeft="14dp">
<TextView android:text="APP_NAME"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#ffffff"
android:textStyle="bold"
android:shadowColor="#231f20"
android:shadowRadius="1.6"
android:shadowDx="1.5"
android:shadowDy="1.3" />
<ImageView android:layout_width="1px"
android:layout_height="fill_parent"
android:background="#00113a"
android:layout_marginLeft="14dp" />
<ImageView android:layout_width="1px"
android:layout_height="fill_parent"
android:background="#8b979f"
android:layout_marginRight="14dp" />
<TextView android:id="@+id/tv_title"
android:text="Dashboard"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#ffffff"
android:textStyle="bold"
android:shadowColor="#231f20"
android:shadowRadius="1.6"
android:shadowDx="1.5"
android:shadowDy="1.3" />
</LinearLayout>