猿问

在编辑文本中放置 $ 但不显示在数据库中

达到类似结果的最佳方法是什么?

我对 android 开发/java 等很陌生,所以我要解决的第一部分是 $ 和每小时提示,它保留在编辑文本输入的右侧。

然后我将处理布尔值是或否,它允许有 2 个具有最小速率和最大速率的编辑文本框,它们将能够输入到数据库中。(如果您对此有任何提示或解决方案,将不胜感激)

例子

我的编码尝试。


    <?xml version="1.0" encoding="utf-8"?>

<android.support.constraint.ConstraintLayout 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"

    tools:context=".MechanicMore.MechanicHourlyRateActivity">


    <TextView

        android:id="@+id/HourlyText"

        android:layout_width="359dp"

        android:layout_height="28dp"

        android:layout_marginEnd="25dp"

        android:text="What is your hourly Rate?"

        android:textColor="@android:color/black"

        android:textSize="18sp"

        android:textStyle="bold"

        app:layout_constraintEnd_toEndOf="parent"

        app:layout_constraintStart_toStartOf="parent"

        app:layout_constraintTop_toTopOf="parent" />


    <android.support.design.widget.TextInputLayout

        android:id="@+id/textInputLayout2"

        android:layout_width="match_parent"

        android:layout_height="wrap_content"

        android:layout_marginTop="25dp"

        android:layout_marginBottom="356dp"

        android:hint="Per Hour"

        app:layout_constraintBottom_toBottomOf="parent"

        app:layout_constraintEnd_toEndOf="parent"

        app:layout_constraintStart_toStartOf="parent"

        app:layout_constraintTop_toBottomOf="@+id/HourlyText">



qq_笑_17
浏览 161回答 1
1回答

翻翻过去那场雪

你可以试试这个...<RelativeLayout&nbsp; &nbsp; android:layout_width="200dp"&nbsp; &nbsp; android:layout_height="wrap_content"&nbsp; &nbsp; android:layout_gravity="center_vertical"&nbsp; &nbsp; android:layout_marginStart="10dp"&nbsp; &nbsp; android:layout_marginEnd="10dp">&nbsp; &nbsp; <android.support.design.widget.TextInputEditText&nbsp; &nbsp; &nbsp; &nbsp; android:id="@+id/editText"&nbsp; &nbsp; &nbsp; &nbsp; android:layout_width="match_parent"&nbsp; &nbsp; &nbsp; &nbsp; android:layout_height="wrap_content"&nbsp; &nbsp; &nbsp; &nbsp; android:layout_marginStart="10dp"&nbsp; &nbsp; &nbsp; &nbsp; android:layout_marginEnd="10dp"&nbsp; &nbsp; &nbsp; &nbsp; android:layout_toStartOf="@+id/rate"&nbsp; &nbsp; &nbsp; &nbsp; android:layout_toEndOf="@+id/dollarSign"&nbsp; &nbsp; &nbsp; &nbsp; android:background="#ffffff"&nbsp; &nbsp; &nbsp; &nbsp; android:gravity="center"&nbsp; &nbsp; &nbsp; &nbsp; android:text="@string/_25"&nbsp; &nbsp; &nbsp; &nbsp; android:textColor="#000000"&nbsp; &nbsp; &nbsp; &nbsp; android:textSize="18sp" />&nbsp; &nbsp; <TextView&nbsp; &nbsp; &nbsp; &nbsp; android:id="@+id/dollarSign"&nbsp; &nbsp; &nbsp; &nbsp; android:layout_width="wrap_content"&nbsp; &nbsp; &nbsp; &nbsp; android:layout_height="wrap_content"&nbsp; &nbsp; &nbsp; &nbsp; android:layout_alignParentStart="true"&nbsp; &nbsp; &nbsp; &nbsp; android:layout_marginStart="5dp"&nbsp; &nbsp; &nbsp; &nbsp; android:text="@string/dollar"&nbsp; &nbsp; &nbsp; &nbsp; android:textColor="#000000"&nbsp; &nbsp; &nbsp; &nbsp; android:textSize="18sp" />&nbsp; &nbsp; <TextView&nbsp; &nbsp; &nbsp; &nbsp; android:id="@+id/rate"&nbsp; &nbsp; &nbsp; &nbsp; android:layout_width="wrap_content"&nbsp; &nbsp; &nbsp; &nbsp; android:layout_height="wrap_content"&nbsp; &nbsp; &nbsp; &nbsp; android:layout_alignParentEnd="true"&nbsp; &nbsp; &nbsp; &nbsp; android:paddingStart="0dp"&nbsp; &nbsp; &nbsp; &nbsp; android:paddingEnd="5dp"&nbsp; &nbsp; &nbsp; &nbsp; android:text="@string/per_hour"&nbsp; &nbsp; &nbsp; &nbsp; android:textColor="@color/colorBlack"&nbsp; &nbsp; &nbsp; &nbsp; android:textSize="18sp" />&nbsp; &nbsp; <View&nbsp; &nbsp; &nbsp; &nbsp; android:layout_width="match_parent"&nbsp; &nbsp; &nbsp; &nbsp; android:layout_height="2dp"&nbsp; &nbsp; &nbsp; &nbsp; android:layout_below="@id/rate"&nbsp; &nbsp; &nbsp; &nbsp; android:layout_marginTop="5dp"&nbsp; &nbsp; &nbsp; &nbsp; android:background="#000000" /></RelativeLayout>
随时随地看视频慕课网APP

相关分类

Java
我要回答