Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/templates/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android上的垂直校准开关_Android_Android Layout_Android Switch - Fatal编程技术网

Android上的垂直校准开关

Android上的垂直校准开关,android,android-layout,android-switch,Android,Android Layout,Android Switch,我正在尝试创建一个布局(Android Studio),我需要在其中垂直对齐各种控件,如下面的屏幕截图中的“切换” 如果将所有需要的水平线性布局嵌套在垂直线性布局中,则应该可以使用 确保使用与问题相关的标签。是与iOS交换机相关的标签。您还没有指定要使用哪种布局?@HenryTwist我使用了Android布局,但开关的垂直对齐在我的scipt xml和图片截图上方显示不好,这要感谢advanceAndroid布局?我问的是视图在哪个视图组中布局。您问题中的视图组上方的视图组是什么约束展开线

我正在尝试创建一个布局(Android Studio),我需要在其中垂直对齐各种控件,如下面的屏幕截图中的“切换”


如果将所有需要的水平线性布局嵌套在垂直线性布局中,则应该可以使用



确保使用与问题相关的标签。是与iOS交换机相关的标签。您还没有指定要使用哪种布局?@HenryTwist我使用了Android布局,但开关的垂直对齐在我的scipt xml和图片截图上方显示不好,这要感谢advanceAndroid布局?我问的是视图在哪个
视图组中布局。您问题中的视图组上方的
视图组是什么<代码>约束展开
<代码>线性布局
RelativeLayout
?…@HenryTwist您希望与什么精确对齐?
    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="40dp"
        android:textAlignment="center"
        android:text="Entrée Chaude" />

    <Switch
        android:id="@+id/switchRespectMenu"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_margin="50px"
        android:switchMinWidth="50dp"
        android:textSize="25sp"
        android:text="RespectMenu : "
        android:checked="false"/>

    <EditText
        android:id="@+id/remarqueRespectMenu"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="56dp"
        android:ems="10"
        android:hint="Remarque RespectMenu"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.184"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <Switch
        android:id="@+id/switchGrammage"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_margin="50px"
        android:switchMinWidth="50dp"
        android:textSize="25sp"
        android:text="Grammage  : "
         />