想改变一下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();
}
解决方案 »
- 关于SeekBar的问题
- (Editable) super.getText(); 运算符顺序是什么
- 请问一下ANDROID的RECOVERY模式。
- PopupWindow显示问题 求指点
- 想用广播来触发一个service,怎么做啊?
- 请大家谈谈Google退出中国对Android影响多大??Android市场如何
- 使用三星的Glayax调试时, Logcat打印, 时间和tag是乱码, 不知怎么解决
- 自定义进度条相关问题
- Android 屏保 图片幻灯片
- Android R文件消失。。。
- 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"
/>
刚试过了,可以的,呵呵