搜索框样式

<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/toolbar"
    android:layout_width="match_parent"
    android:layout_height="?actionBarSize"
    app:contentInsetStart="0dp">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_alignParentBottom="true"
        android:gravity="center"
        android:orientation="horizontal">

        <LinearLayout
            android:id="@+id/llScan"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginBottom="7dp"
            android:layout_marginStart="15dp"
            android:layout_marginTop="7dp"
            android:clickable="true"
            android:focusable="true"
            android:gravity="center"
            android:orientation="vertical">

            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="0dp"
                android:layout_marginBottom="2dp"
                android:layout_weight="1"
                android:src="@mipmap/scan" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="扫一扫"
                android:textColor="@color/colorBarText"
                android:textSize="9sp" />
        </LinearLayout>

        <EditText
            android:id="@+id/toobar_et"
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_marginBottom="10dp"
            android:layout_marginLeft="15dp"
            android:layout_marginRight="15dp"
            android:layout_marginTop="10dp"
            android:layout_weight="1"
            android:background="@drawable/shape_seek"
            android:cursorVisible="false"
            android:drawablePadding="10dp"
            android:drawableStart="@mipmap/seek"
            android:hint="搜一搜"
            android:padding="10dp"
            android:textColor="@color/colorBarText"
            android:textColorHint="@color/colorBarText"
            android:textSize="12sp" />

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginBottom="7dp"
            android:layout_marginEnd="15dp"
            android:layout_marginTop="7dp"
            android:gravity="center"
            android:orientation="vertical">

            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="0dp"
                android:layout_marginBottom="2dp"
                android:layout_weight="1"
                android:src="@mipmap/more" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="更多"
                android:textColor="@color/colorBarText"
                android:textSize="9sp" />
        </LinearLayout>
    </LinearLayout>
</android.support.v7.widget.Toolbar>

猜你喜欢

转载自blog.csdn.net/qq_42993958/article/details/82834160
今日推荐