我正在使用 Crouron 库,并且我的操作栏设置为 FEATURE_ACTION_BAR_OVERLAY,如何将 Crouton 设置为从操作栏下方开始?,我尝试使用 marginTop 作为自定义视图,这是我的代码:
LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:ignore="Overdraw"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:layout_marginTop="?attr/actionBarSize"
android:background="@layout/round_edges_solid_grey_back"
android:padding="10dp">
<ImageView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/cruton_image"
android:src="@drawable/ic_launcher"
/>
<LinearLayout android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginLeft="5dp"
android:orientation="vertical">
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:id="@+id/cruton_text_a"
android:textColor="#fff"
android:text="asa" />
<TextView android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#fff"
android:id="@+id/cruton_text_b"
android:text="sdfgs" />
但是,视图似乎仍然从操作栏后面弹出,我很清楚,知道吗?