4
ImageViewとTextViewを含むLinearLayoutの代わりに複合ドローアブルを使用するにはどうすればよいですか
新しいLintツールをコードに対して実行しました。良い提案がたくさん出てきましたが、これはわかりません。 このタグとその子は、1つの複合ドローアブルで置き換えることができます 問題:複合ドローアブルを使用して、現在のノードをTextViewで置き換えることができるかどうかを確認します。 ImageViewとTextViewを含むLinearLayoutは、複合ドローアブルとしてより効率的に処理できます。 そして、これが私のレイアウトです <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal" android:layout_centerInParent="true"> <ImageView android:id="@+id/upImage" android:layout_width="20dp" android:layout_height="20dp" android:layout_gravity="center_vertical" android:scaleType="centerInside" android:src="@drawable/up_count_big"> </ImageView> <TextView android:id="@+id/LikeCount" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="2dp" android:layout_marginBottom="1dp" android:textColor="@color/gray" android:textSize="16sp" android:layout_gravity="center_vertical"> </TextView> </LinearLayout> この場合、誰かが化合物を描画可能にする方法の具体的な例を提供できますか?