2017-11-29 2 views
1

私はAndroidで新しく、RadioGroupのサイズを変更する方法がわかりません。私はそれを小さくしようとするとradioButtonsが消えて2番目の画像のように見えます。 radioGroupは、editTextをカバーしません。どのように私はそれを行うことができますか?ここで![How it looks in AndroidStudio]レイアウト上のラジオグループのサイズを変更する方法は?

を支援するためのおかげで私のxmlです

<android.support.constraint.ConstraintLayout 
     android:id="@+id/constraintMain" 
     android:layout_width="match_parent" 
     android:layout_height="match_parent" 
     tools:layout_editor_absoluteX="0dp" 
     tools:layout_editor_absoluteY="81dp"> 
    <RadioGroup 
      android:id="@+id/rgSex" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_marginEnd="78dp" 
      android:layout_marginLeft="8dp" 
      android:layout_marginRight="78dp" 
      android:layout_marginStart="8dp" 
      android:layout_marginTop="4dp" 
      android:gravity="center_horizontal" 
      android:orientation="horizontal" 
      android:textAlignment="center" 
      android:visibility="visible" 
      app:layout_constraintHorizontal_bias="1.0" 
      app:layout_constraintLeft_toLeftOf="parent" 
      app:layout_constraintRight_toRightOf="parent" 
      app:layout_constraintTop_toTopOf="parent"> 

      <RadioButton 
       android:id="@+id/rbMen" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_marginLeft="8dp" 
       android:layout_marginRight="8dp" 
       android:layout_marginTop="170dp" 
       android:text="Чоловік" 
       app:layout_constraintHorizontal_bias="0.39" 
       app:layout_constraintLeft_toLeftOf="parent" 
       app:layout_constraintRight_toRightOf="parent" 
       app:layout_constraintTop_toTopOf="parent" /> 

      <RadioButton 
       android:id="@+id/rbWomen" 
       android:layout_width="wrap_content" 
       android:layout_height="wrap_content" 
       android:layout_marginLeft="8dp" 
       android:layout_marginRight="8dp" 
       android:layout_marginTop="170dp" 
       android:text="Жінка" 
       app:layout_constraintHorizontal_bias="0.781" 
       app:layout_constraintLeft_toLeftOf="parent" 
       app:layout_constraintRight_toRightOf="parent" 
       app:layout_constraintTop_toTopOf="parent" /> 
     </RadioGroup> 

    </android.support.constraint.ConstraintLayout> 
+0

XMLコードを投稿 – Munir

+0

私を助けることができますか? –

答えて

1
あなたはあなたのコードを変更する必要が

  1. 両方からmarginTopを削除しますラジオボタン

    アンドロイド:layout_marginTopは= "170dp"

  2. は親

    アプリで、テキストを編集するラジオ グループトップの制約はない提供:このラジオ・グループの変更でlayout_constraintTop_toTopOf = "親"

あなたの編集テキストのIDを

app:layout_constraintTop_toBottomOf="@+id/editText2" 
+0

男、あなたは最高です!おかげで多く) –

+0

@ GenadiyNaumovあなたを助けて幸せ。 – Munir

+0

@GenadiyNaumov答えがあなたを助けてくれたら正解としてそ​​れを受け入れることもできます – Munir

関連する問題