在Android中,可以设置可绘制对象的边距吗? [英] In Android, is it possible to set the margin from the drawable?
本文介绍了在Android中,可以设置可绘制对象的边距吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想这样做,以便可以更改动画列表中的边距.
I want to do this so I can change the margin within an animation-list.
这会将按钮从屏幕边缘移近或移远.
This would move the button closer or further from the edge of the screen.
推荐答案
这是不可能的,但创建这样的动画很容易
This isn't possible but it's easy to create an animation like so
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/accelerate_interpolator">
<translate android:fromYDelta="0" android:toYDelta="100%" />
</set>
,然后只需将动画添加到对象并启动它.
and then simply add the animation to the object and start it.
这篇关于在Android中,可以设置可绘制对象的边距吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文