Mar*_*aes -1 android visibility textview
我有一个活动,其中包含一些元素,例如ImageViews,TextViews,EditTexts和Button。一切正常,但运行该应用程序时看不到两个TextView。预览还可以,但是当我在手机中打开应用程序时,它不会显示。
这是我的XML代码:
<RelativeLayout 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:orientation="vertical"
tools:context="com.construct.v2.activities.auth.PasswordChangeActivity">
<!--<include android:id="@+id/toolbar" layout="@layout/toolbar_simple" />-->
<ProgressBar
android:id="@+id/progressBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="@dimen/mm_margin"
android:layout_gravity="center"
android:visibility="gone"/>
<RelativeLayout
android:id="@+id/contentLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingLeft="24dp"
android:paddingRight="24dp"
android:paddingTop="80dp">
<ImageView
android:id="@+id/change_lock"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/change_pass"
android:layout_centerHorizontal="true"/>
<TextView
android:id="@+id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="20sp"
android:fontFamily="sans-serif-medium"
android:textStyle="normal"
android:textColor="#00596f"
android:lineSpacingExtra="2sp"
android:layout_centerHorizontal="true"
android:layout_below="@id/change_lock"
tools:text="@string/change_password"
/>
<TextView
android:id="@+id/subtitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="16sp"
android:fontFamily="sans-serif"
android:textStyle="normal"
android:textColor="#555555"
android:lineSpacingExtra="4sp"
android:layout_below="@+id/title"
android:layout_centerHorizontal="true"
android:paddingTop="15dp"
tools:text="@string/new_password_text"
/>
<TextView
android:id="@+id/fill_password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/subtitle"
android:textColor="@color/construct_red"
android:paddingTop="15dp"
/>
<EditText
android:id="@+id/password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/password"
android:textSize="16dp"
android:textColorHint="#b1b1b1"
android:layout_below="@+id/fill_password"
android:backgroundTint="#00596f"
android:textColor="#00596f"
android:textCursorDrawable="@drawable/color_cursor"
android:inputType="textPassword"
/>
<Button
android:id="@+id/saveButton"
android:layout_width="220dp"
android:layout_height="40dp"
android:text="@string/save"
android:textSize="14dp"
android:gravity="center"
android:layout_centerHorizontal="true"
android:textColor="#b1b1b1"
android:background="#e3e3e3"
android:paddingLeft="56dp"
android:paddingRight="56dp"
android:layout_below="@+id/password"
android:layout_marginTop="32dp"/>
</RelativeLayout>
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
这是来自Android Studio的预览:
这是我手机中运行的应用程序:
您正在使用设置文本 tools
tools:text="@string/new_password_text"
Run Code Online (Sandbox Code Playgroud)
改成:
android:text="@string/new_password_text"
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
181 次 |
| 最近记录: |