대화 상자 레이아웃에서 cachapa/ExpandableLayout을 사용하고 있는데 예기치 않은 애니메이션이 있습니다. 내 말은, 확장 가능한 레이아웃은 안으로 들어 가지 않고 부드럽게 움직이지만, 갑자기 나타납니다. 위의 사진을 볼 수 있듯이ExpandableLayout animation not smooth
, 나는 Utils.setWindowGravity(getWindow(), Gravity.BOTTOM);
을 사용하여 화면의 하단에있는 대화 상자를 배치합니다. TOP으로 변경하면 애니메이션은 fine으로 작동합니다. 하지만 제 경우에는 BOTTOM으로 설정해야합니다. 어떻게 해결할 수 있습니까?
고해상도/레이아웃 :
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<!--other views-->
<net.cachapa.expandablelayout.ExpandableLayout
android:id="@+id/expand_add"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
app:el_duration="500"
app:el_expanded="false">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<EditText
android:id="@+id/name"
style="@style/EditText_BorderedMiddle_Grey_F"
android:layout_width="match_parent"
android:layout_weight="1"
android:hint="@string/dialog_categories_hintname"/>
<ImageView
android:id="@+id/submit"
style="@style/ImageView_FilledMiddle_Blue_F_50"
android:src="@drawable/ic_check_white_48dp"/>
</LinearLayout>
</net.cachapa.expandablelayout.ExpandableLayout>
<!--other views-->
</LinearLayout>
자바
public class CategoriesDialog extends AppCompatDialog {
//other codes
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Utils.setWindowGravity(getWindow(), Gravity.BOTTOM);
//...
}
@OnClick(R.id.add)
public void onAddClick() {
expandAdd.toggle();
}
}
public class Utils {
public static void setWindowGravity(Window window, int gravity) {
WindowManager.LayoutParams attributes = window.getAttributes();
attributes.gravity = gravity;
window.setAttributes(attributes);
}
}
위로 가기 선형 레이아웃에서 animatelayoutchanges = true를 추가하려고합니다. –
답장을 보내 주셔서 감사합니다. 나는 노력했지만 여전히 일하지 않습니다. –
사용자 정의 클래스 코드 또는 라이브러리 의사 확인 –