ScrollView with CardView does not work

0

I want to use a ScrollView to put in a CardView and a vertical button, I made this XML and if it compiles, but when it is time to test it on a device, the app closes immediately. The device on which I am doing the test is API 22:

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

<ScrollView 
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.valenzuela.salvador.apuebacalculo.MainActivity">>

<TextView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/seleccione"
    android:text="Seleccione el area de Calculo a estudiar:"
    android:textSize="18sp"
    android:paddingTop="5dp"
    android:paddingLeft="12dp" />

<android.support.v7.widget.CardView
    android:onClick="uno"
    android:id="@+id/cardView"
    android:layout_width="match_parent"
    android:layout_height="223dp"
    app:cardCornerRadius="6dp"
    app:cardElevation="10dp"
    app:cardUseCompatPadding="true"
    app:layout_constraintTop_toBottomOf="@+id/seleccione"
    tools:layout_editor_absoluteX="0dp">

    <ImageView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:scaleType="centerCrop"
        android:src="@drawable/diferencial" />

    <TextView
        android:id="@+id/txt2"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom"
        android:background="#8c000000"
        android:padding="10dp"
        android:text="Calculo Diferencial"
        android:textColor="#ffe3e3e3"
        android:textSize="30sp"
        android:textStyle="bold" />
</android.support.v7.widget.CardView>

<android.support.v7.widget.CardView
    android:onClick="dos"
    android:layout_width="match_parent"
    android:layout_height="223dp"
    app:cardCornerRadius="6dp"
    app:cardElevation="10dp"
    app:cardUseCompatPadding="true"
    app:layout_constraintTop_toBottomOf="@+id/cardView"
    tools:layout_editor_absoluteX="16dp">

    <ImageView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:scaleType="centerCrop"
        android:src="@drawable/integral" />

    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom"
        android:background="#8c000000"
        android:padding="10dp"
        android:text="Calculo Integral"
        android:textColor="#ffe3e3e3"
        android:textSize="30sp"
        android:textStyle="bold" />
</android.support.v7.widget.CardView>
</ScrollView>

This is my gradle file:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "com.valenzuela.salvador.apuebacalculo"
        minSdkVersion 15
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    implementation 'com.android.support:cardview-v7:26.1.0'
    implementation files('libs/YouTubeAndroidPlayerApi.jar')
}
    
asked by isalvinator 03.12.2017 в 00:58
source

0 answers