Android - Cuando modifico el background de mas de un EditText se me elimina el background del layout

 
Vista:

Cuando modifico el background de mas de un EditText se me elimina el background del layout

Publicado por Joaquín B (1 intervención) el 23/10/2017 21:46:49
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/activity_register"
    android:layout_width="match_parent"
    android:background="@drawable/Ledyba_wallpaper"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context="com.example.buzzles.epc.Register">
 
    <Space
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true" />
 
    <LinearLayout
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
 
 
        <EditText
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:inputType="textPersonName"
            android:ems="10"
            android:id="@+id/Text_nombre"
            android:textAlignment="center"
            android:background="@drawable/back"
            android:hint="Ash Ketchup"
            android:singleLine="true" />
 
 
 
        <EditText
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:inputType="textPassword"
            android:ems="10"
            android:id="@+id/Text_contrasenia"
            android:textAlignment="center"
            android:hint="Password"
        <!-- Si pongo esto se elimina el fondo del layout:
        android:background="@drawable/back" -->
            />
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

otras maneras

Publicado por akzule (5 intervenciones) el 05/11/2017 03:16:24
Pues intenta programar los backgrounds desde java:

1
2
3
4
//el primer texto tendrá la id texto1
TextView primer_texto=(TextView)findViewById(R.id.texto1)
 
primer_texto.setBackground("@drawable/back");

El otro texto será igual pero con otra id
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar