我已经设置了一个具有以下可绘制背景的LinearLayout:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="10dp" />
<solid android:color="#CCFFFFFF"/>
</shape>
Run Code Online (Sandbox Code Playgroud)
我遇到的问题是在LinearLayout中我有另一个LinearLayout元素位于它的父元素的底部.由于没有圆角,其角落延伸超过父母的左下角和右下角.
Child LinearLayout上的可绘制背景如下所示:
<?xml version="1.0" encoding="utf-8"?>
<bitmap
xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/pedometer_stats_background"
android:tileMode="repeat"
/>
Run Code Online (Sandbox Code Playgroud)
问题看起来像这样:设备上的http://kttns.org/hn2zm非剪辑更明显.
完成剪辑的最佳方法是什么?
如果有人能向我解释为什么这样有效,我将非常感激:
private void startAnimating() {
TextView logo1 = (TextView) findViewById(R.id.Shizzle);
final Animation fade1 = new AlphaAnimation(0.0f, 1.0f);
fade1.setDuration(3000);
logo1.startAnimation(fade1);
}
Run Code Online (Sandbox Code Playgroud)
但这对我来说根本不起作用:
private void startAnimating() {
TextView logo1 = (TextView) findViewById(R.id.Shizzle);
Animation fade1 = AnimationUtils.loadAnimation(this,R.anim.fade_in);
logo1.startAnimation(fade1);
}
Run Code Online (Sandbox Code Playgroud)
与上面相关的fade_in.xml是:
<?xml version="1.0" encoding="utf-8"?>
<set
xmlns:android="http://schemas.android.com/apk/android"
android:shareInterpolator="false">
<alpha
android:fromAlpha="0.0"
android:toAlpha="1.0"
android:duration="3000">
</alpha>
Run Code Online (Sandbox Code Playgroud)
谢谢你的帮助!