[英]Android - How to create image button of different states, default , pressed and focussed
In my android application i want to create three different image of a single image for each state pressed , default and focussed. 在我的android应用程序中,我想为每种状态(按,默认和聚焦)创建单个图像的三个不同图像。 Is there any tool that can help me to create these images.
有没有什么工具可以帮助我创建这些图像。
I think you misunderstood my problem, i knows that how to use three different image for three different states. 我认为您误解了我的问题,我知道如何为三种不同的状态使用三种不同的图像。 I only wants to know that how two create those three images.
我只想知道两个如何创建这三个图像。
here http://code.google.com/p/iosched/source/browse/android/#android%2Fres%2Fdrawable-hdpi you can see that there are three different images for three differenct states 在http://code.google.com/p/iosched/source/browse/android/#android%2Fres%2Fdrawable-hdpi中,您可以看到针对三种不同状态存在三种不同的图像
I wants to know that is there any tool that can create the above three images. 我想知道有没有可以创建上述三个图像的工具。 I think now my question is clear to everyone.
我想我的问题现在对每个人都清楚。
My Question was that how to add white border for default image , gray border for focussed image. 我的问题是,如何为默认图像添加白色边框,为聚焦图像添加灰色边框。 I know that how to change image according to different states.
我知道如何根据不同的状态更改图像。 I want to ask you that is there any tool that can put white or gray border around my image.
我想问你,是否有任何工具可以在我的图像周围放置白色或灰色边框。
Use selector save this file in drawable/click.xml 使用选择器将此文件保存在drawable / click.xml中
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" >
<item android:state_pressed="false" android:drawable="@drawable/notPressedImage ></item>
<item android:state_pressed="true" android:drawable="@drawable/PressedImage" ></item>
</selector>
use click.xml (click) as button src... 使用click.xml(click)作为按钮src ...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.