0

本当に簡単に解決できると思う何かに行き詰まっていることに気づきます。私のアプリには多数の TextView と ImageView が含まれており、1 つの TextView にはリストされたコンテンツが含まれています。表示されたコンテンツの各要素を、それぞれの TextView に内部的にリンクしたいと考えています。おそらく TextView は使用するのに適切な要素ではありませんが、適切な要素を見つけるのに苦労しています。

内部リンクは、html ドキュメントの内部リンクとまったく同じように機能するはずです...これは Android で実現できますか?

文字列.xml:

<string name="c3">3. Contents</string>
<string name="c4">1. Abstract
\n3. Contents
\n4. List of Abbreviations
\n5. Introduction
\n6. Materials &amp; Methods
\n6.1 Literature Selection
\n6.2 Method
\n6.3 What is Android?
\n6.3.1 Dalvik Virtual Machine and Android Applications
\n6.3.2 Android Structure, Java and XML
\n6.3.3 Android Versions
\n6.4 The Development Environment
\n6.4.1 Android SDK
\n6.4.2 Eclipse IDE
\n6.4.3 Android Virtual Device
\n6.4.4 Secure Digital Card
\n6.5 “Hello World!” as Test of IDE
\n6.6 Test Application
\n6.7 Developing Strategy
\n7. Result
\n7.1 Facebook Connect
\n7.1.1 Facebook Application
\n7.1.2 Facebook Connect for Android
\n7.2 Networking
\n7.3 Data Synchronization
\n8. Discussion
\n9. Conclusion
\n10. References
\n10.1 Internet References
\n10.2 Lecture References\n\n
</string>

main.xml:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@color/smoke"
    android:scrollbars="vertical"
>
    <ScrollView android:id="@+id/ScrollView01"
        android:layout_width="wrap_content" 
        android:layout_height="fill_parent"
        android:scrollbars="none"
    >
        <LinearLayout android:id="@+id/LinearLayout02"
            android:layout_width="wrap_content" 
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:paddingLeft="4px"
            android:paddingRight="4px"
        >

        <TextView  
            android:layout_width="fill_parent"
            android:layout_height="wrap_content" 
            android:text="@string/a"
            android:textColor="@color/black"
            android:gravity="center_horizontal"
            android:textSize="16dp"
            android:paddingBottom="2dp"
            android:paddingTop="20dp"
            android:scrollbars="vertical"    
        />
        <TextView
            android:layout_width="fill_parent"
            android:layout_height="wrap_content" 
            android:text="@string/b"
            android:gravity="center_horizontal"
            android:textColor="@color/black"
            android:scrollbars="vertical"
        />
        <TextView  
            android:layout_width="fill_parent"
            android:layout_height="wrap_content" 
            android:text="@string/c1"
            android:textColor="@color/black"
            android:textSize="20dp"
            android:paddingBottom="2dp"
            android:scrollbars="vertical"
        />
        <TextView
            android:layout_width="fill_parent"
            android:layout_height="wrap_content" 
            android:text="@string/c2"
            android:textColor="@color/black"
            android:scrollbars="vertical"
         />
4

1 に答える 1

2

私があなたなら、あなたのコンテンツを内部リンク付きの HTML に変換し、 を使用しWebViewて表示します。他の方法でやろうとしていることをどのようにやってのけるのか、私にはわかりません。さらに、それは電子ブックに使用される典型的なアプローチであり、あなたが作成しようとしているもののようです。

于 2010-09-05T20:08:39.507 に答える