View setAnimation之后再setVisibility不起作用

本文详细解释了在动画处理中遇到的视图可见性改变和触摸事件丢失的问题,提供了两种解决方案:将`animation.setFillAfter(true)`更改为`false`或在动画的View外部嵌套一个View。此问题源于动画期间视图被位图替换,导致后续操作无法正确作用于实际视图。

前提是你的Animation设置了这样一个属性:

 final Animation animation;animation.setFillAfter(true);

原因:

      All the animations (before android 3.0) are actually applied to a bitmap which is a snapshot of your view instead of on your original view. When you are setting the fill after to true this actually means that the bitmap will continue to be displayed on the screen instead of your view. This is the reason why the visibility won't change upon using setVisibility and also the reason why your view will not be receiving touch events in its new (rotated) bounds.

解决方案:

1、将setFillAfter设置为false,或者不设置(默认是false)

2、在你要做动画的View外部嵌套一个View

### SetAnimation Function Usage in STK In the context of STK (Satellite Tool Kit), `SetAnimation` does not directly apply as it would within Android development or other software environments where animations are handled through methods like `setAnimation` and `startAnimation`. In STK, animation primarily revolves around visualizing scenarios over time, including satellite movements, sensor coverage areas, and more. For setting up an animation sequence that plays back a scenario in STK: 1. **Scenario Definition**: Define the elements involved in your scenario such as satellites, ground stations, sensors etc., which will be animated. 2. **Time Configuration**: Configure the start and stop times for the scenario using the Time System dialog box available under the View menu[^1]. 3. **Playback Control**: Utilize playback controls provided by STK to play, pause, rewind, fast-forward, and adjust speed settings for the visualization of events unfolding over time. 4. **Custom Animation Creation**: For custom animations involving specific behaviors beyond standard playback features, scripting with VBA (Visual Basic for Applications) can automate complex sequences or interactions between objects within the simulation environment. To integrate MATLAB scripts into STK workflows for enhanced automation capabilities related to data processing or analysis before/after running simulations, one might consider leveraging both tools together via COM interface connections[^2], though this pertains less specifically to "setting" animations than controlling overall workflow processes. ```matlab % Example of connecting MATLAB to STK using COM Interface stkApp = actxserver('AgSTKVgt.StkServer'); root = stkApp.Root; ``` --related questions-- 1. How do you define multiple objects interacting within a single STK scenario? 2. What options exist for exporting high-quality video files from completed STK animations? 3. Can external Python libraries interact similarly with STK's API for creating automated tests or analyses? 4. Are there any limitations when integrating large datasets into real-time STK visualizations?
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值