将应用程序中的xml文件以jpeg格式下载到外部存储中

时间:2019-04-24 15:42:18

标签: android xml jpeg

我的activity_main.xml上有一个cardView,带有线性布局,以及textView和imageButtons。如何将具有随机彩色背景的TextView下载为jpeg文件并将其存储在手机的外部存储中?

!(https://ibb.co/pR74664

!(https://ibb.co/LhGyqqZ

activity_main.xml

<?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"
    android:background="@android:color/white"
    tools:context=".MainActivity">

    <com.wenchao.cardstack.CardStack
        android:id="@+id/container"
        android:layout_width="match_parent"
        android:layout_height="500dp"
        android:layout_marginTop="16dp"
        android:clipChildren="false"
        android:clipToPadding="false"
        android:gravity="center"
        android:padding="10dp"
        app:card_enable_loop="true"
        app:card_enable_rotation="true"
        app:card_gravity="top"
        app:card_margin="10dp"
        app:card_stack_size="4"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="32dp"
        android:onClick="favActivity"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="0.5"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/container" />

0 个答案:

没有答案