TextView Android dynamic width

0

I have the following VIEW,

<LinearLayout
    android:id="@+id/activity_activation_step1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:focusable="true"
    android:background="@color/grisclaro"
    android:focusableInTouchMode="true"
    android:orientation="vertical"
    android:gravity="center">
    <include layout="@layout/actionbar_toolbar"/>
    <View
        android:layout_width="fill_parent"
        android:layout_height="2dip"
        android:background="@color/light_grey" />
    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="100dp"
        android:layout_marginTop="55dp"
        android:orientation="vertical">
       <TextView
           android:layout_width="60dp"
           android:layout_height="100dp"
           android:text="$"
           android:textSize="50dp"
           android:textColor="@color/black"
           android:layout_marginLeft="50dp"
           android:layout_marginStart="50dp"
           android:layout_centerVertical="true"
           android:layout_alignLeft="@+id/txtbalance"
           android:layout_alignStart="@+id/txtbalance" />

        <TextView
            android:layout_width="match_parent"
            android:layout_height="150dp"
            android:id="@+id/txtbalance"
            android:textColor="@color/black"
            android:textSize="70dp"
            android:text="20.0"
            android:layout_centerHorizontal="true"
            android:gravity="center"
            android:layout_marginLeft="60dp"/>

        <TextView
            android:layout_width="60dp"
            android:layout_height="90dp"
            android:text="USD"
            android:textSize="20dp"
            android:layout_marginTop="10dp"
            android:textColor="@color/black"
            android:layout_centerVertical="true"
            android:layout_alignRight="@+id/txtbalance"
            android:layout_alignEnd="@+id/txtbalance"
            android:layout_marginRight="16dp"
            android:layout_marginEnd="16dp"
            android:id="@+id/textView2" />
    </RelativeLayout>

    <View
        android:layout_width="fill_parent"
        android:layout_height="1dip"
        android:layout_marginLeft="25dp"
        android:layout_marginRight="25dp"
        android:background="@color/light_grey" />
    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginTop="50dp"
        android:orientation="vertical">

        <TextView
            android:id="@+id/InfoAccountBalance"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_marginLeft="30dp"
            android:layout_marginRight="30dp"
            android:text="La cuenta 10, Correspondiente a 097777777 "
            android:textColor="@color/black"
            android:textSize="30dp" />

    </RelativeLayout>
</LinearLayout>

up here all right, but that's because I have a number 20.0, if it were to have 2.0000, the numbers would cover me the sign of pesos and the currency, then my question is how can I solve this issue?

    
asked by Bruno Sosa Fast Tag 27.12.2017 в 14:45
source

0 answers