目胜朗星 2022-03-13 18:29 采纳率: 100%
浏览 100
已结题

Android studio 中的EditText在输入内容时不可见,且排列向下

问题遇到的现象和发生背景

Android studio 中的EditText在输入内容时不可见,且排列向下,

问题相关代码,请勿粘贴截图
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    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:orientation="vertical"
    android:background="@drawable/loginone"
    tools:context=".LoginActivity">
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:layout_marginTop="540dp"
        android:layout_marginStart="10dp">
        <TextView
            android:text="用户名:"
            android:textSize="30sp"
            android:textColor="#000000"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"/>
        <EditText
            android:id="@+id/editTEXT_inputname"
            android:textSize="30sp"
            android:textColor="#000000"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"/>
    </LinearLayout>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:layout_margin="10dp">
        <TextView
            android:text="密    码:"
            android:textSize="30sp"
            android:textColor="#000000"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"/>
        <EditText
            android:id="@+id/editTETX_inputpwd"
            android:textSize="30sp"
            android:textColor="#000000"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"/>
    </LinearLayout>

    <CheckBox
        android:id="@+id/checkBox_reme"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="right"
        android:layout_margin="10dp"
        android:text="记住密码" />

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:layout_margin="10dp">
        <Button
            android:id="@+id/button_login"
            android:text="登录"
            android:textSize="30sp"
            android:textColor="#000000"
            android:layout_weight="1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@drawable/button"/>
        <Button
            android:text="取消"
            android:textSize="30sp"
            android:textColor="#000000"
            android:layout_weight="1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@drawable/button"/>
    </LinearLayout>

</LinearLayout>

运行结果及报错内容

输入内容之前

img

输入内容之后

img

我想要达到的结果

img

  • 写回答

1条回答 默认 最新

  • 不会写代码的猴子 Android领域优质创作者 2022-03-14 10:00
    关注

    img


    文字太大了,改成17sp试试

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

    报告相同问题?

    问题事件

    • 系统已结题 4月23日
    • 已采纳回答 4月15日
    • 创建了问题 3月13日

    悬赏问题

    • ¥15 Qt播放10路ffmpeg 视频流
    • ¥15 如何利用闲置机械硬盘变现
    • ¥15 信号处理中的凸优化问题
    • ¥15 arm虚拟机无法和物理机互通
    • ¥15 Android导航条遮盖异常
    • ¥15 计算机网络技术基础问题
    • ¥15 设置mac系统只能访问指定网站
    • ¥15 西门子博途 s7 1200控制三台步进电机
    • ¥15 基于非参数的方向距离函数求污染物影子价格(有偿)
    • ¥15 vue+element 生成table