대화 상자를 아래쪽으로 설정하려하지만이를 수행 할 수 없습니다. 페이지 상단을 표시합니다.대화 상자를 맨 아래에 배치하는 방법
XML :
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout 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="370dp"
android:background="@android:color/transparent"
xmlns:tools="http://schemas.android.com/tools"
android:padding="8dp"
android:orientation="vertical">
<android.support.v7.widget.CardView
android:id="@+id/cv1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardCornerRadius="4dp"
app:cardElevation="1dp"
app:cardUseCompatPadding="true">
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/textView14"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="@color/colorSecondaryBackground"
android:fontFamily="@font/gotham_medium_regular"
android:padding="8dp"
android:text="Send Promotions"
android:textColor="@color/colorSecondaryText"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<android.support.constraint.ConstraintLayout
android:id="@+id/promotionDataLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="@dimen/two_margin"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/textView14">
<android.support.v7.widget.RecyclerView
android:id="@+id/promotionList"
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="@id/guidelineEnd"
app:layout_constraintStart_toStartOf="@id/guidelineStart"
app:layout_constraintTop_toTopOf="parent">
</android.support.v7.widget.RecyclerView>
<android.support.constraint.Guideline
android:id="@+id/guidelineStart"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.08" />
<android.support.constraint.Guideline
android:id="@+id/guidelineEnd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.92" />
</android.support.constraint.ConstraintLayout>
</android.support.v7.widget.CardView>
</android.support.constraint.ConstraintLayout
</android.support.constraint.ConstraintLayout>
</ScrollView>
</android.support.v7.widget.CardView>
<android.support.design.widget.FloatingActionButton
android:id="@+id/fabDone"
android:layout_width="64dp"
android:layout_height="64dp"
android:src="@drawable/red_plus"
app:layout_anchor="@+id/cv1"
app:elevation="1dp"
app:backgroundTint="@android:color/white"
app:layout_anchorGravity="center|bottom" />
</android.support.design.widget.CoordinatorLayout>
내가 같은 대화 상자 클래스를 만드는 오전 :
class PromotionDialog:Dialog{
var mContext:Context?=null
constructor(context: Context) : super(context) {}
constructor(context: Context, themeResId: Int) : super(context, themeResId) {
mContext=context
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.promotion_layout)// use your layout in place of this.
window.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT));
}
}
해결이 시도 :
디자인 제약으로 인해 바닥 시트 다이얼로그를 사용할 수 없습니다.
편집 : 나는이
val promotionDialog= PromotionDialog([email protected], android.R.style.Theme_Material_Light_NoActionBar_Fullscreen)
promotionDialog.show()
편집 2와 같은 대화 상자를 호출 오전 : @RAJA 제안으로
는,이 때문에 전체 화면 테마이었다. 그래서
은 지금은에 테마를 변경 있습니다
<style name="ThemeDialog" parent="@style/Theme.AppCompat.Light.Dialog">
<item name="android:windowBackground">@null</item>
<item name="android:background">@android:color/transparent</item>
<item name="android:windowMinWidthMajor">100%</item>
<item name="android:windowMinWidthMinor">100%</item>
<item name="android:windowIsFloating">true</item>
</style>
하지만 여전히 바닥
트라이 d this, working .. 내 업데이트 된 게시물보기 – Raja
어떤 테마를 사용중인 응용 프로그램 매니페스트 파일 – Raja
Theme.AppCompat.Light.NoActionBar @Raja에서 사용하고 있습니다. 끝났어. 고정 된 높이 때문이었습니다. 감사합니다 –