私はちょうどアンドロイドプログラミングの学習を始めました。 scollview機能を備えたシンプルなアプリです。テキスト部分はうまくスクロールしますが、画像がスクロールして表示されようとしているときには、スクロールが遅くなり、アプリがハングアップしているように見えますが、スクロールは画像の最後で完了します。スクロールビューを使用するとアンドロイドアプリで画像がゆっくりと読み込まれます
この理由とこの問題を解決する方法を知っていますか?あなたは画像サイズで見たいと思うかもしれません
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.nitishsinha.parsefeed.ParseFeed">
<LinearLayout
android:id="@+id/activity_parse_feed"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
>
<TextView
android:id="@+id/Title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/imageTitle" />
<TextView
android:id="@+id/Date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/imageDate" />
<ImageView
android:id="@+id/Image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ganpati" />
<TextView
android:id="@+id/Description"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/imageDesc" />
</LinearLayout>
</ScrollView>
ありがとう!はい。私は問題が画像のサイズが大きいために起こっていると理解し、画像のサイズを小さくするのに役立ちます。しかし、問題は、私はパースフィード用のアプリケーションを構築する過程にあるため、手動でイメージのサイズを縮小することはできません。私はコードを使用する必要があります。私はこのサイトで利用できるコードを使用しましたが、問題はまだ解決されていません:https://developer.android.com/topic/performance/graphics/load-bitmap.html –