Android提示问题xml

时间:2019-03-12 21:59:57

标签: android xml

我添加了一个android:hint =“ utilizador”,但是当我运行和测试应用程序时,标签会掉落。它应该在文本框中

enter image description here

  camera = new OrthographicCamera(500,600);
    stage.getHeight();
    stage.getWidth();
   extendViewport =new ExtendViewport(500,1500, camera);
    stage=new Stage(extendViewport);

    Table scrollableTable = new Table();
    scrollableTable.setFillParent(true);
    stage.addActor(scrollableTable);

    Table table = new Table();
    table.add(label2).spaceBottom(1200).row();

    //table.add(smile).spaceBottom(2300).row();
    table.add(label).spaceBottom(2300).row();
    table.add(menuButton1).row();
    //table.add(topbutton).spaceBottom(2300).row();
    table.add(label3).spaceBottom(2300).row();


    table.pack();
    table.setTransform(true);  //clipping enabled

    stage.setDebugAll(true);
    table.setOrigin(table.getWidth()/2,table.getHeight()/2);
    // table.setScale(.5f);

    final ScrollPane scroll = new ScrollPane(table);
    scrollableTable.add(scroll).expand().fill();
    Gdx.input.setInputProcessor(stage);

3 个答案:

答案 0 :(得分:0)

AutoCompleteTextView不能作为TextInputLayout的子级,因为您无法获得AutoCompleteTextView的有效功能或设计。从TextInputLayout中取出它,或将AutoCompleteTextView替换为TextInputEditText

答案 1 :(得分:0)

将您的 TextInputLayout 替换为下面的

 <android.support.design.widget.TextInputLayout
            android:layout_width="match_parent"
            android:layout_height="71dp"
            android:gravity="center_vertical">

答案 2 :(得分:0)

为避免提示问题,您可以简单地使用它。这实际上是替代解决方案:

         <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="USERNAME"
            android:textAlignment="center"
            android:textAppearance="@style/Base.TextAppearance.AppCompat.Caption"
            android:textColor="@color/colorPrimary" />

        <android.support.design.widget.TextInputEditText
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:inputType="text"
            android:maxLength="50"
            android:maxLines="1"
            android:singleLine="true"
            android:textAppearance="@style/Base.TextAppearance.AppCompat.Large"
            android:textColor="@color/colorPrimary"
            android:textStyle="bold" />