簡體   English   中英

如何使用滾動視圖將布局另存為圖像?

[英]How to save layout as an image with scroll view?

我的用戶界面就像

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout...>
  <ScrollView .../>
   ...
</LinearLayout...>

我可以將整個LinearLayout保存為位圖。 但是一旦使用滾動條,輸出將不是我期望的“完成”圖像。

你能給我一些提示嗎?

謝謝您的幫助

使ScrollView作為父級...

<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/scroll"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
>

 <LinearLayout
        android:layout_width="318dp"
        android:layout_height="495dp"
 >
Your other content
</LinearLayout>
</ScrollView>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM