【发布时间】:2016-08-20 10:01:22
【问题描述】:
我不确定这是否可以使用 setEnterTransition() 和 setExitTransition() 方法来实现。
【问题讨论】:
标签: android material-design bottom-sheet
我不确定这是否可以使用 setEnterTransition() 和 setExitTransition() 方法来实现。
【问题讨论】:
标签: android material-design bottom-sheet
我使用 StyleAnimation 解决了
@Override
public void onActivityCreated(@Nullable Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
if (getDialog() != null && getDialog().getWindow() != null)
getDialog().getWindow().getAttributes().windowAnimations = R.style.DialogAnimation;
}
slide_in.xml
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:fromYDelta="100%p"
android:toYDelta="0"
android:duration="3000"/> <!--Define duration here-->
</set>
slide_out.xml
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:fromYDelta="0"
android:toYDelta="100%p"
android:duration="5000"/> <!--Define duration here-->
</set>
【讨论】:
我想我得到了答案:
我可以使用getDialog().getWindow().setWindowAnimations() 方法来实现。
【讨论】: