我正在学习android屏幕设计。我之前也遇到过类似的问题。我正在使用LinearLayout。现在我正在使用ConstrainLayout。我实际上有两个问题。首先,我的横幅没有出现。我找不到解决方案,我也在学习constraitlayout。其次,我的texviews(00:00)正确显示在设计屏幕上,但是当我运行该应用程序时,texview会滑动。最后,如果您告诉我我犯了哪些错误,我将不胜感激。我的代码在这里;
<?xml version="1.0" encoding="utf-8"?>
<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="match_parent"
android:background="#fffdd0"
tools:context=".MainActivity">
<android.support.constraint.Guideline
android:id="@+id/guidelineV1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.95" />
<android.support.constraint.Guideline
android:id="@+id/guidelineV2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.05" />
<android.support.constraint.Guideline
android:id="@+id/guidelineH1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_percent="0.98" />
<android.support.constraint.Guideline
android:id="@+id/guidelineH2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_percent="0.02">
</android.support.constraint.Guideline>
<android.support.constraint.Guideline
android:id="@+id/guidelineH3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_percent="0.10">
</android.support.constraint.Guideline>
<android.support.constraint.Guideline
android:id="@+id/guidelineH4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_percent="0.4">
</android.support.constraint.Guideline>
<android.support.constraint.Guideline
android:id="@+id/guidelineH5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_percent="0.85">
</android.support.constraint.Guideline>
<Button
android:id="@+id/btn_kalp1"
android:layout_width="50dp"
android:layout_height="40dp"
android:layout_alignParentStart="true"
android:background="@drawable/kalp"
app:layout_constraintStart_toStartOf="@+id/guidelineV2"
app:layout_constraintTop_toTopOf="@+id/guidelineH2" />
<TextView
android:id="@+id/tv_countdown1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:text="00:00"
android:textColor="@color/colorPrimary"
android:textSize="14sp"
app:layout_constraintStart_toStartOf="@+id/guidelineV2"
app:layout_constraintTop_toBottomOf="@+id/btn_kalp1" />
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_marginStart="55dp"
android:layout_marginTop="20dp"
android:text="X"
android:textColor="@color/colorPrimary"
android:textSize="10sp"
app:layout_constraintStart_toStartOf="@+id/btn_kalp1"
app:layout_constraintTop_toTopOf="@+id/guidelineH2" />
<TextView
android:id="@+id/tv_kalp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:text="5"
android:textColor="@color/colorPrimary"
android:textSize="20sp"
app:layout_constraintStart_toStartOf="@+id/textView3"
app:layout_constraintTop_toTopOf="@id/guidelineH2" />
<Button
android:id="@+id/btn_double"
android:layout_width="0dp"
android:layout_height="47dp"
android:layout_marginStart="40dp"
android:layout_marginEnd="0dp"
android:background="@drawable/xx"
app:layout_constraintEnd_toStartOf="@+id/btn_yariyariya"
app:layout_constraintStart_toStartOf="@+id/tv_kalp"
app:layout_constraintTop_toTopOf="@+id/guidelineH2" />
<TextView
android:id="@+id/tv_countdown2x"
android:layout_width="0dp"
android:layout_height="20dp"
android:layout_marginStart="110dp"
android:layout_marginTop="1dp"
android:layout_marginEnd="10dp"
android:text="00:00"
android:textAlignment="gravity"
android:textColor="@color/colorPrimary"
android:textSize="13sp"
app:layout_constraintEnd_toStartOf="@+id/tv_countdown50"
app:layout_constraintStart_toStartOf="@id/guidelineV2"
app:layout_constraintTop_toBottomOf="@+id/btn_double" />
<Button
android:id="@+id/btn_yariyariya"
android:layout_width="0dp"
android:layout_height="49dp"
android:layout_marginStart="0dp"
android:layout_marginEnd="0dp"
android:background="@drawable/fiftyfifty"
app:layout_constraintEnd_toStartOf="@+id/btn_skip"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/btn_double"
app:layout_constraintTop_toTopOf="@+id/guidelineH2" />
<TextView
android:id="@+id/tv_countdown50"
android:layout_width="0dp"
android:layout_height="18dp"
android:layout_marginEnd="10dp"
android:text="00:00"
android:textAlignment="gravity"
android:textColor="@color/colorPrimary"
android:textSize="13sp"
app:layout_constraintEnd_toStartOf="@+id/tv_countdownNext"
app:layout_constraintTop_toBottomOf="@+id/btn_yariyariya" />
<Button
android:id="@+id/btn_skip"
android:layout_width="0dp"
android:layout_height="45dp"
android:layout_marginStart="0dp"
android:layout_marginTop="1dp"
android:layout_marginEnd="40dp"
android:background="@drawable/skip"
app:layout_constraintEnd_toStartOf="@+id/btn_satinal"
app:layout_constraintStart_toEndOf="@+id/btn_yariyariya"
app:layout_constraintTop_toTopOf="@+id/guidelineH2" />
<TextView
android:id="@+id/tv_countdownNext"
android:layout_width="0dp"
android:layout_height="18dp"
android:layout_marginTop="1dp"
android:layout_marginEnd="95dp"
android:text="00:00"
android:textAlignment="gravity"
android:textColor="@color/colorPrimary"
android:textSize="13sp"
app:layout_constraintEnd_toEndOf="@id/guidelineV1"
app:layout_constraintTop_toBottomOf="@+id/btn_skip" />
<FrameLayout
android:id="@+id/container_pop_up"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="@+id/btn_satinal"
android:layout_width="50dp"
android:layout_height="40dp"
android:background="@drawable/satinal"
android:onClick="satinalMain"
app:layout_constraintEnd_toStartOf="@+id/guidelineV1"
app:layout_constraintTop_toTopOf="@+id/guidelineH2" />
<TextView
android:id="@+id/tv_countdown"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:textColor="@color/colorPrimary"
android:textSize="30sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/guidelineH3"
tools:text="00:30" />
<TextView
android:id="@+id/tv_soru"
android:layout_width="0dp"
android:layout_height="0dp"
android:fontFamily="@font/incee"
android:gravity="center"
android:textAlignment="gravity"
android:textColor="#000"
android:textSize="18sp"
app:layout_constraintBottom_toTopOf="@+id/guidelineH4"
app:layout_constraintEnd_toEndOf="@id/guidelineV1"
app:layout_constraintStart_toStartOf="@+id/guidelineV2"
app:layout_constraintTop_toBottomOf="@+id/tv_countdown" />
<Button
android:id="@+id/btn_a"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginStart="60dp"
android:layout_marginTop="20dp"
android:layout_marginEnd="60dp"
android:layout_marginBottom="5dp"
android:background="@drawable/gradient"
android:elegantTextHeight="true"
android:fontFamily="@font/incee"
android:shadowColor="#E91E63"
android:textAlignment="gravity"
android:textColor="#000"
android:textSize="12sp"
app:layout_constraintBottom_toTopOf="@+id/btn_b"
app:layout_constraintEnd_toEndOf="@+id/guidelineV1"
app:layout_constraintStart_toStartOf="@+id/guidelineV2"
app:layout_constraintTop_toTopOf="@+id/guidelineH4" />
<Button
android:id="@+id/btn_b"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginStart="60dp"
android:layout_marginTop="5dp"
android:layout_marginEnd="60dp"
android:layout_marginBottom="5dp"
android:background="@drawable/gradient"
android:elegantTextHeight="true"
android:fontFamily="@font/incee"
android:textAlignment="gravity"
android:textColor="#000"
android:textSize="12sp"
app:layout_constraintBottom_toTopOf="@+id/btn_c"
app:layout_constraintEnd_toEndOf="@+id/guidelineV1"
app:layout_constraintStart_toStartOf="@+id/guidelineV2"
app:layout_constraintTop_toBottomOf="@+id/btn_a" />
<Button
android:id="@+id/btn_c"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginStart="60dp"
android:layout_marginTop="5dp"
android:layout_marginEnd="60dp"
android:layout_marginBottom="5dp"
android:background="@drawable/gradient"
android:elegantTextHeight="true"
android:fontFamily="@font/incee"
android:textAlignment="gravity"
android:textColor="#000"
android:textSize="12sp"
app:layout_constraintBottom_toTopOf="@+id/btn_d"
app:layout_constraintEnd_toEndOf="@id/guidelineV1"
app:layout_constraintStart_toStartOf="@+id/guidelineV2"
app:layout_constraintTop_toBottomOf="@+id/btn_b" />
<Button
android:id="@+id/btn_d"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginStart="60dp"
android:layout_marginTop="5dp"
android:layout_marginEnd="60dp"
android:layout_marginBottom="60dp"
android:background="@drawable/gradient"
android:elegantTextHeight="true"
android:fontFamily="@font/incee"
android:textAlignment="gravity"
android:textColor="#000"
android:textSize="12sp"
app:layout_constraintBottom_toTopOf="@+id/guidelineH5"
app:layout_constraintEnd_toEndOf="@+id/guidelineV1"
app:layout_constraintStart_toStartOf="@+id/guidelineV2"
app:layout_constraintTop_toBottomOf="@+id/btn_c"
app:layout_constraintVertical_bias="0.0" />
<Button
android:id="@+id/btn_infoA"
android:layout_width="50dp"
android:layout_height="50dp"
android:background="@drawable/info"
app:layout_constraintBottom_toTopOf="@+id/guidelineH5"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent" />
<Button
android:id="@+id/btn_gec"
android:layout_width="75dp"
android:layout_height="70dp"
android:background="@drawable/next"
app:layout_constraintBottom_toTopOf="@id/guidelineH5"
app:layout_constraintEnd_toStartOf="@id/guidelineV1" />
<com.google.android.gms.ads.AdView
android:id="@+id/adView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:adSize="BANNER"
app:adUnitId="ca-app-pub-3101578796185185/4912585915"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
</com.google.android.gms.ads.AdView>
<Button
android:id="@+id/btn_reklam"
android:layout_width="50dp"
android:layout_height="45dp"
android:background="@drawable/plus"
android:onClick="startVideoAd"
app:layout_constraintStart_toStartOf="@id/guidelineV2"
app:layout_constraintTop_toBottomOf="@id/guidelineH5" />
<TextView
android:id="@+id/tv_kalp_kazan"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="55dp"
android:layout_marginTop="15dp"
android:layout_marginBottom="5dp"
android:fontFamily="@font/incee"
android:text="İzle Kazan"
android:textColor="#000"
android:textSize="15sp"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="@id/guidelineV2"
app:layout_constraintTop_toBottomOf="@id/guidelineH5" />
<TextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:layout_marginEnd="50dp"
android:text="SKOR :"
android:textColor="#000"
android:textSize="15sp"
android:textStyle="bold"
app:layout_constraintEnd_toStartOf="@id/guidelineV1"
app:layout_constraintTop_toBottomOf="@id/guidelineH5" />
<TextView
android:id="@+id/tv_skor"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginEnd="25dp"
android:text="0"
android:textColor="#000"
android:textSize="25sp"
app:layout_constraintEnd_toStartOf="@id/guidelineV1"
app:layout_constraintTop_toBottomOf="@id/guidelineH5"
/>