【发布时间】:2020-05-21 17:48:55
【问题描述】:
我是编码新手,我正在进行文本冒险,希望 imageview 根据位置更改图像,我想知道它是如何工作的,为什么这个解决方案不工作。根据玩家的位置来做会更好吗?我在哪里可以找到有关这方面的信息,因为我遇到了一些麻烦。 谢谢
<room>
<east>1</east>
<description>Room 1(0)</description>
<ImageView
android:id="@+id/ImageView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/bedroom"
/>
</room>
<room>
<east>2</east>
<west>0</west>
<description>Room 2(1)</description>
<ImageView
android:id="@+id/imagePlace1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/living"
/>
</room>
<room>
<west>1</west>
<description>Room 3(2)</description>
<ImageView
android:id="@+id/imagePlace2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/kitchen"
/>
</room>```
【问题讨论】:
标签: xml android-studio imageview