線形レイアウトだけでなく、アプリ画面をキャプチャしようとしています。
atm 私はこれを使用していますが、これはうまくいくと思いますが、IDK y はそうではありません。必要な線形レイアウトだけでなく、電話のすべての画面をキャプチャします
final LinearLayout ll = (LinearLayout) findViewById(R.id.Linear);
View v1 = ll.getRootView();
v1.setDrawingCacheEnabled(true);
Bitmap bm = v1.getDrawingCache();
私のxmlの一部:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:id="@+id/Linear" >
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="match_parent" >
<ImageView
android:layout_width="60dp"
android:layout_height="60dp" />
</RelativeLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="0"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="10dp" />
<ImageView
android:layout_width="15dp"
android:layout_height="18dp"
android:layout_marginRight="10dp"
android:src="@drawable/ll" />
<ImageView
android:layout_width="15dp"
android:layout_height="20dp"
android:src="@drawable/lle" />
</LinearLayout>
atm では、3 つのイメージビューと 2 つのテキストビューのみを含む linearlayout をキャプチャする必要がありますが、すべての xml または画面をキャプチャします。