如何使用滚动视图将布局保存为图像?

时间:2013-10-22 07:42:25

标签: android android-layout

我的用户界面就像是

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

我可以将整个LinearLayout保存为位图。 但是一旦我使用滚动条,输出就不是 像我预期的那样“完成”的形象。

请你给我一些提示吗?

感谢您的帮助

1 个答案:

答案 0 :(得分:1)

将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>
相关问题