当前位置: 首页 > 知识库问答 >
问题:

呈现问题注意:一个或多个布局缺少layout_width或layout_height属性。这些在大多数布局中都是必需的

梁丘高朗
2023-03-14
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:gravity="center_horizontal"
    android:orientation="vertical"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    android:background="@color/backgroundDark"
    tools:context="coalesce.collabup.LoginActivity">

    <!-- Login progress -->
    <ProgressBar
        android:id="@+id/login_progress"
        style="?android:attr/progressBarStyleLarge"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginBottom="8dp"
        android:visibility="gone" />

    <ScrollView
        android:id="@+id/login_form"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <LinearLayout
            android:id="@+id/email_login_form"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical">

            <TextView
                android:id="@+id/Logo"
                android:layout_height="match_parent"
                android:layout_width="match_parent"
                android:text="CollabUp"
                android:textSize="70sp"
                android:lineSpacingExtra="8sp"
                android:typeface="normal"
                android:textAlignment="center"
                android:textStyle="normal|bold" />
            <TextView
                android:id="@+id/motto"
                android:layout_height="match_parent"
                android:layout_width="match_parent"
                android:text="Collaboration at its finest"
                android:textStyle="normal|bold"
                android:textAlignment="center"
                android:layout_marginTop="20dp"
                android:layout_marginBottom="50dp" />

            <android.support.design.widget.TextInputLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

                <AutoCompleteTextView
                    android:id="@+id/email"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:hint="Email"
                    android:inputType="textEmailAddress"
                    android:maxLines="1"
                    android:singleLine="true"
                    android:textSize="18sp"
                    android:padding="10dp"
                    android:layout_marginBottom="10dp" />

            </android.support.design.widget.TextInputLayout>

            <android.support.design.widget.TextInputLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
               >

                <EditText
                    android:id="@+id/password"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:hint="Password"
                    android:imeActionId="@+id/login"
                    android:imeActionLabel="Sign In"
                    android:imeOptions="actionUnspecified"
                    android:inputType="textPassword"
                    android:maxLines="1"
                    android:singleLine="true" />

            </android.support.design.widget.TextInputLayout>
<RelativeLayout
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    >
            <CheckBox
                android:text="keep me log in?"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:id="@+id/checkBox2"
                android:layout_marginTop="10dp" />

            <Button
                android:id="@+id/email_sign_in_button"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_marginTop="16dp"
                android:text="Sign In"
                android:textStyle="bold"
                android:layout_marginLeft="250dp"
                android:layout_marginBottom="10dp"

                />
</RelativeLayout>
            <TextView
                android:layout_height="match_parent"
                android:layout_width="match_parent"
                android:id="@+id/registertxt"
                android:text="New to CollabUp? Create an Account now!"
                android:textStyle="normal|bold"
                android:textAlignment="center"
                android:textSize="14sp"
                android:onClick="gotoRegister"
                android:layout_marginBottom="20dp" />

            <TextView
                android:layout_height="match_parent"
                android:layout_width="match_parent"
                android:id="@+id/forgettxt"
                android:text="Forgot your password?"
                android:textStyle="normal|bold"
                android:textAlignment="center"
                android:onClick="gotoSendForget"
                android:textSize="14sp" />
            <TextView
                android:layout_height="match_parent"
                android:layout_width="match_parent"
                android:id="@+id/creditstxt"
                android:text="Coalesce 2016 - All rights Reserved - CollabUp"
                android:textStyle="normal|bold"
                android:textColor="@android:color/white"
                android:textAlignment="center"
                android:textSize="14sp"
                android:layout_marginTop="20dp" />
        </LinearLayout>
    </ScrollView>
</LinearLayout>

暂时还没有答案

 类似资料:
  • 本文向大家介绍vue 实现 rem 布局或vw 布局的方法,包括了vue 实现 rem 布局或vw 布局的方法的使用技巧和注意事项,需要的朋友参考一下 一、实现 rem 布局 移动端 方法一、在 index.html 或者 main.js 中添加以下代码: 之后,在写 css 时,只要将 px 单位替换成 rem,这里设置的比例是 100px=1rem,例如,宽度为 100px 时,可以直接写成

  • 请问这种 space-between 两端对齐的,最后一行 怎样靠左和上面的一样正常显示,而不是最后一个跑到最右边去了, 网上找了很多,加伪类之类的方法都不行,请问如何去做合适?

  • 问题内容: 我的布局基本上全部统一,其中包含应用程序主供稿所需的所有内容。首先将所有可变项(图像,视频缩略图等等)设置为,并在需要时设置为。 问题是,有时,可能是由于的回收行为,这是supposedto是该项目是在错误的地方。 范例: 项目1包含文字 项目2包含图片 项目3包含图片 我一直向下滚动到编号x,然后向上滚动,这就是我得到的: 项目1包含来自项目x的图片,有时包含项目3 项目2包含图片

  • 有没有办法在Java中使用多个布局管理器。现在我正在使用gridLayout来实现一个国际象棋棋盘,但在它下面我想放一些其他的东西,但不是在gridLayout中。可能是流程布局或其他布局。我该怎么做呢?谢谢

  • 要求是这样的(目前的话换行单选多选判断换行展示已经处理完了): 但是现在有个问题就是选项的个数问题,选项最多是9个(也就是从A~I),最少是3~4个(判断的选项就是两个,但是若遇到判断就换行了,倒是不用太操心),选项个数不固定每题的宽度就不固定,宽度不固定列数就不固定,列数有影响到了行数,但又要求每列得对齐。 大致就是: 1.选项个数不固定 2.支持横排、竖排的切换 3.每列得对齐 所以想问问各位