本文介绍了如何使上点击TextView的金光闪闪的效果呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我是新到Android development.I要创建的onclick效果TextView的。当我点击的TextView将金光闪闪什么影响make.I与变色尝试过,但它不工作。我怎样才能使对TextView的bling的效果的onclick?
请帮助我的例子code。在此先感谢:)

Hi I am new to android development.I want to create onclick effects to textview. When I click on the textview it will bling or something effects make.I tried it with change color, but its not working . How can I make bling effect on textview onclick ??please help me with example code . thanks in advance :)

推荐答案

创建一个XML与名称类似txt_bg.xml

create a xml with name something like txt_bg.xml

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

    <item android:drawable="@drawable/numpad_button_bg_selected" android:state_selected="true"></item>
    <item android:drawable="@drawable/numpad_button_bg_pressed" android:state_pressed="true"></item>
    <item android:drawable="@drawable/numpad_button_bg_normal"></item>

</selector>

然后添加texview XML

then add in texview xml

android:background="@drawable/txt_bg"
android:clickable="true"

希望这会有所帮助。

hope it will help.

这篇关于如何使上点击TextView的金光闪闪的效果呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-03 13:13