简体   繁体   English

搜索图标-镜头-具有3种状态

[英]Search Icons - lens - with the 3 states

I need the icons of the standard Android search button - lens - with 3 states normal, focused, pressed. 我需要标准Android搜索按钮的图标-lens-具有正常,聚焦,按下3种状态。 could any one provide me with this icons with 3 states? 谁能为我提供带有3种状态的图标?

regards, 问候,

It can be automatic in Android. 在Android中可以是自动的。 follow the example. 根据例子。 you can replace "state_orange" with any image files: 您可以将“ state_orange”替换为任何图像文件:

for your control: 供您控制:

android:background="@color/back_color_selector_blue_gradient"

back_color_selector_blue_gradient.xml: back_color_selector_blue_gradient.xml:

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_pressed="true" android:drawable="@drawable/state_orange" />
    <item android:state_selected="true" android:drawable="@drawable/state_orange" /> <!-- focused -->
    <item android:drawable="@drawable/background07" /> <!-- default -->
</selector>

background07.xml: background07.xml:

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">


    <item>
        <shape android:shape="rectangle">
            <gradient android:startColor="@color/grayBlue3"
                android:endColor="@color/lightBlue" android:angle="270"
                android:centerColor="@color/lightBlue" />
            <!-- border width and color -->
            <stroke android:width="1dp" android:color="#FFDDDDDD" />
            <padding android:left="1dp" android:top="1dp" android:right="1dp"
                android:bottom="1dp" />
        </shape>
    </item>

</layer-list>

state_orange.xml: state_orange.xml:

<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <solid android:color="@color/orange" />
</shape>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM