サムスンI9003でスクロールすると、ビューによってグラフィックノイズが発生します。何が問題なのですか?
まず、特定の構造を含むXMLファイルを読み取り、その構造をarrayListに配置します。
arrayListの各要素についてiDo:
//ここに5px*10pxのような小さな画像があります
tr = new TableRow(this);
ImageView triangle = new ImageView(this);
params = new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
params.gravity = 0x11;
params.span = 8;
triangle.setBackgroundResource(R.drawable.complex_grey_down);
triangle.setLayoutParams(params);
tr.addView(triangle);
tl.addView(tr, params);
// here goes main title of the row
tr = new TableRow(this);
child = new TextView(this);
child.setText(sn.getName());
params = new LayoutParams(LayoutParams.FILL_PARENT,
LayoutParams.FILL_PARENT);
params.gravity = 0x11;
params.span = 8;
child.setTypeface(null, Typeface.BOLD);
child.setTextColor(res.getColor(R.color.text));
child.setLayoutParams(params);
tr.addView(child);
tl.addView(tr, params);
// here goes short note under the title
if (sn.getNote().length() > 0) {
tr = new TableRow(this);
child = new TextView(this);
child.setText(sn.getNote());
child.setTextSize(12);
child.setPadding(30, 5, 30, 10);
child.setTextColor(res.getColor(R.color.text));
child.setGravity(Gravity.CENTER);
params = new LayoutParams(LayoutParams.FILL_PARENT,
LayoutParams.FILL_PARENT);
params.gravity = 0x11;
params.span = 8;
child.setLayoutParams(params);
tr.addView(child);
}
tl.addView(tr, params);
}
その電話のように10行以上を追加した後は、それを処理できません。この構造は一部の電話には複雑すぎますか?また、テーブルレイアウトと、複数のテキストビューと少量のイメージビューを含む複雑な行を使用することは、このようなコンテンツに適したソリューションです。
sackOfViewsAdapterを実装しましたが、役に立ちません。同じサムスンの電話アプリケーションでは正しく動作しません。インストール後に初めてアプリケーションを起動すると、すべてが正常に動作し、画面にラグやグラフィックの「ノイズ」が発生しませんが、アプリケーションを強制的に閉じて再度起動すると、これらの奇妙なことがすべて発生します。