2013-10-22 58 views
0

我的UI是一樣的東西如何使用滾動視圖將佈局保存爲圖像?

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

我整個的LinearLayout保存爲位圖。 但是,一旦我使用滾動條,輸出不是 「已完成」的圖像,如我所料。

你能給我一些提示嗎?

感謝您的幫助

+0

什麼是「輸出不是‘已完成’的形象如我所料」呢? –

+0

http://stackoverflow.com/questions/18205769/taking-screenshot-of-activity-programatically。檢查它是否有幫助 – Raghunandan

回答

1

使滾動型父...

<?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>