【发布时间】:2013-12-03 16:25:00
【问题描述】:
我正在制作我的第一个应用程序,我需要一些帮助。
如何通过单击超链接文本打开已在我的应用中预设的图像?
我正在尝试
例如,
“参考Image001”
当用户点击“Image001”这个词时,一个窗口会打开预设图片,当我按下返回按钮时它会关闭。
这是我目前所拥有的
在strings.xml中
<string name="refer">Refer to Image001</string>
在activity_main.xml中
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<ScrollView
android:layout_width="fill_parent"
android:layout_height="match_parent" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:gravity="left"
android:text="@string/refer" />
</ScrollView>
</LinearLayout>
谢谢
【问题讨论】:
-
Catherine:为 textview 添加侦听器并将图像 url 传递给它..参考这个它会帮助你..stackoverflow.com/questions/9079170/…
标签: android