Answer the question
In order to leave comments, you need to log in
How to quickly make a click effect for an ImageView or Button with a picture?
There is some image or a programmatically created Drawable that is assigned to an ImageView or Button. It is necessary to make the effect of pressing, so that it is fast and as beautiful as possible.
How to do it?
Answer the question
In order to leave comments, you need to log in
Does this option work?
SELECT `id`, `country_id`, `title` FROM `country_regions` WHERE `country_id` IN ('3', '1') LIMIT 1
This error occurs if you get data in more than 1 column in a subquery. It's not clear from your example what's going on. What result is expected from these requests?
And what effect are you interested in, namely animation, or changing the color, border, changing the font size?
Then it can be done with styles.
For example red button
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" >
<shape>
<solid
android:color="#ef4444" />
<stroke
android:width="1dp"
android:color="#992f2f" />
<corners
android:radius="3dp" />
<padding
android:left="10dp"
android:top="10dp"
android:right="10dp"
android:bottom="10dp" />
</shape>
</item>
<item>
<shape>
<gradient
android:startColor="#ef4444"
android:endColor="#992f2f"
android:angle="270" />
<stroke
android:width="1dp"
android:color="#992f2f" />
<corners
android:radius="3dp" />
<padding
android:left="10dp"
android:top="10dp"
android:right="10dp"
android:bottom="10dp" />
</shape>
</item>
</selector>
android:state_pressed="true"
means when the button is pressed, for example, these are different states, you can read more
about such states here - for example, this way
you can completely change the design of the button
Then you hook this style to the button in the layout<Button
android:id="@+id/btnCansel"
style="@style/button"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/custom_red_button"
android:onClick="onClickCanselButton"
android:text="@string/clear" />
android:background="@drawable/custom_red_button"
style with the description of different states attached to the button.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question