Test Foro de elhacker.net SMF 2.1

Programación => Programación General => Java => Mensaje iniciado por: Baal_30 en 24 Enero 2016, 13:32 PM

Título: No me aparecen botones en Android
Publicado por: Baal_30 en 24 Enero 2016, 13:32 PM
Muy buenas, hacía tiempo que no escribía por aquí :P

Tengo un problemita, tengo un código en XML en android, pero no me aparecen los botones que me deberían aparecer, y a un compañero con el mismo código (sino he visto nada mal) si que le aperecen... Aquí os dejo el código en XML, el del build gradle y una captura.

Código (xml) [Seleccionar]
<?xml version="1.0" encoding="utf-8"?>
<android.support.percent.PercentRelativeLayout
   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="com.example.vesprada.simondiu.MainActivity" >

   <android.support.v7.widget.AppCompatButton
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:id="@+id/btnVerde"
       app:layout_widthPercent="50%"
       app:layout_heightPercent="50%"
       app:layout_marginLeftPercent="0%"
       app:layout_marginTopPercent="0%"
       android:backgroundTint="@color/verde"
       />

   <android.support.v7.widget.AppCompatButton
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       app:layout_widthPercent="50%"
       app:layout_heightPercent="50%"
       app:layout_marginLeftPercent="50%"
       app:layout_marginTopPercent="0%"
       android:id="@+id/btnRojo"
       android:backgroundTint="@color/rojo"
       />


   <android.support.v7.widget.AppCompatButton
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       app:layout_widthPercent="50%"
       app:layout_heightPercent="50%"
       app:layout_marginLeftPercent="0%"
       app:layout_marginTopPercent="50%"
       android:id="@+id/btnAmarillo"
       android:backgroundTint="@color/amarillo"/>

   <android.support.v7.widget.AppCompatButton
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       app:layout_widthPercent="50%"
       app:layout_heightPercent="50%"
       app:layout_marginLeftPercent="50%"
       app:layout_marginTopPercent="50%"
       android:id="@+id/btnAzul"
       android:backgroundTint="@color/azul"/>

   <android.support.v7.widget.AppCompatTextView
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:text="0"
       android:layout_centerInParent="true"
       android:textSize="30dp"
       android:textColor="@color/verde"
       android:background="@color/negro"
       android:paddingRight="30dp"
       android:paddingLeft="30dp"
       android:paddingTop="20dp"
       android:paddingBottom="20dp"
       android:elevation="30dp"
       android:id="@+id/tvMarcador"
       />
   <Button
       android:id="@+id/btnStart"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:text="Start"
       android:layout_below="@+id/tvMarcador"
       android:layout_alignEnd="@+id/tvMarcador"
       android:layout_alignStart="@+id/tvMarcador"
       android:elevation="20dp"
       />

   <Button
       android:id="@+id/btnPuntuaciones"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:text="Best Scores"
       android:layout_below="@+id/btnStart"
       android:layout_alignEnd="@+id/btnStart"
       android:layout_alignStart="@+id/btnStart"/>


</android.support.percent.PercentRelativeLayout>


Código (xml) [Seleccionar]
apply plugin: 'com.android.application'

android {
   compileSdkVersion 23
   buildToolsVersion "23.0.2"

   defaultConfig {
       applicationId "com.example.vesprada.simondiu"
       minSdkVersion 17
       targetSdkVersion 23
       versionCode 1
       versionName "1.0"
   }
   buildTypes {
       release {
           minifyEnabled false
           proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
       }
   }
}

dependencies {
   compile fileTree(dir: 'libs', include: ['*.jar'])
   testCompile 'junit:junit:4.12'
   compile 'com.android.support:appcompat-v7:23.1.1'
   compile 'com.android.support:design:23.1.1'
   compile 'com.android.support:percent:23.1.1'

}


(http://thumbs.subefotos.com/84063f2397a5c33beb9f52fb352e4cf4o.jpg) (http://subefotos.com/ver/?84063f2397a5c33beb9f52fb352e4cf4o.png)
Un saludo.
Título: Re: No me aparecen botones en Android
Publicado por: Uzumaki_Naruto en 24 Enero 2016, 21:39 PM
Puedes probar cambiando el layout Holo por Theme.