我有一个活动的Android应用程序......
我希望布局像this image
我使用参考link
折叠工具栏布局但我没有得到我想要的输出。
我尝试的是跟随..
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<android.support.design.widget.AppBarLayout
android:id="@+id/materialup.appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/agent_detail_collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
app:layout_scrollFlags="scroll|exitUntilCollapsed"
app:statusBarScrim="?attr/colorPrimaryDark"
app:contentScrim="@android:color/transparent"
app:titleEnabled="false">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorPrimary"
android:orientation="horizontal"
android:padding="15dp"
android:elevation="5dp">
<ImageView
android:layout_width="100dp"
android:layout_height="100dp"
android:id="@+id/agent_detail_pic"
android:layout_gravity="top"
android:src="@drawable/holder_image"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1.5"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:paddingBottom="5dp"
android:gravity="top"
android:layout_marginLeft="10dp"
android:orientation="vertical">
<TextView
android:id="@+id/agent_detail_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="left"
android:text="Agent Name"
android:textColor="@color/white"
android:textSize="18dp"
android:textStyle="bold"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/agent_detail_type"
android:layout_marginTop="5dp"
android:text="Buying Agent, Selling Agent"
android:textColor="@color/white"
android:textSize="14dp"/>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/agent_detail_address"
android:layout_marginTop="5dp"
android:text="Philadelphia, NewYork"
android:textColor="@color/white"
android:textStyle="bold"
android:textSize="14dp"/>
</LinearLayout>
</LinearLayout>
<android.support.v7.widget.Toolbar
android:id="@+id/agent_detail_toolbar"
android:layout_width="match_parent"
android:layout_height="120dp"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
</android.support.design.widget.CollapsingToolbarLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/white_rounded_rect"
android:layout_marginLeft="12dp"
android:layout_marginRight="12dp">
<android.support.design.widget.TabLayout
android:id="@+id/agent_detail_tabs"
android:layout_width="fill_parent"
android:layout_height="48dp"
android:background="@drawable/white_rounded_rect"
app:tabIndicatorColor="@color/colorPrimary"
app:tabIndicatorHeight="4dp"
app:tabSelectedTextColor="@color/colorPrimary"
app:tabTextColor="@color/colorPrimaryDark" />
</LinearLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v4.view.ViewPager
android:id="@+id/agent_detail_viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
</android.support.design.widget.CoordinatorLayout>
建议我如何才能获得这种类型的布局..
提前致谢。