我是一个有用的助手,可以为您进行翻译。以下是您需要翻译的内容:
我有一个静态布局文件,就像这样:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:layout_width="56dp"
android:layout_height="56dp"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="24dp"
android:src="@drawable/some_drawable" />
<TextView
android:id="@id/placeholder_error_info"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="something"
/>
</LinearLayout>
我希望能够在我的应用程序中多次重用此布局文件,但根据每个用例更改文本和src属性。
我不想复制布局文件,为此使用自定义视图似乎过度。在框架中是否有解决方案?