想改变一下Textview的位置,比如左移多少,右移多少,形成抖动的效果。
用下面代码试着改变下控件的位置,发现不行。高手们,如何处理呀?//改变球的位置
private void changeLocation(TextView tv){
int top = tv.getTop();
int left = tv.getLeft();
tv.layout(left + 20, top, left + 20 + tv.getWidth(), top + tv.getHeight());
tv.invalidate();
}
用下面代码试着改变下控件的位置,发现不行。高手们,如何处理呀?//改变球的位置
private void changeLocation(TextView tv){
int top = tv.getTop();
int left = tv.getLeft();
tv.layout(left + 20, top, left + 20 + tv.getWidth(), top + tv.getHeight());
tv.invalidate();
}
解决方案 »
- 我的android出现个很简单又解决不了的问题,求大牛看看,,equals会报错
- 关于使用wifimanager的问题
- phonegap的调用地理位的gps接口,还有人成功调用过啊,为什么我在手机上测试没有任何返回信息呢,求大神
- 现在开发android用哪个版本的eclipse好啊,还有我现在编程,编着编着R.java就没了?!求指导!
- Android应用程序利用USB和外部一个展台设备通讯
- Android下如何获得刚刚输入的字符是那个字符?
- 在framework层调用哪个接口可以强制刷屏下?
- 使用vs2010怎么开发安卓!
- SQLite手机上无法创建数据库
- 按钮点击功能不能实现,重启之后还是不行,Monitors提示如下。
- android 显示TextView 的指定位置 周三下班(5:30)之前解决。
- 用videoView播放视频,mp4在本地可以,为何放在网路上就不行?
动态的发送消息提示页面更新这样的
我记得是可以让一个EditText在输入完成的时候左右抖动
貌似在app—>animation里面
Animation shake = AnimationUtils.loadAnimation(this, R.anim.shake);
findViewById(R.id.pw).startAnimation(shake);<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2007 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
--><cycleInterpolator xmlns:android="http://schemas.android.com/apk/res/android" android:cycles="7" />
[code=XML]
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2007 The Android Open Source Project Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
--><translate xmlns:android="http://schemas.android.com/apk/res/android"
android:fromXDelta="0"
android:toXDelta="10"
android:duration="1000"
android:interpolator="@anim/cycle_7"
/>
刚试过了,可以的,呵呵