なんらかの理由で、現在2つのTextViewのみが含まれている私のscrollviewは、その親を埋めることを拒否します。 scrollviewのためのXMLは以下の通りです:Scrollviewのテキストが親の高さと一致しません
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/Article"
android:layout_width="fill_parent"
android:layout_height="match_parent"
android:background="@drawable/background"
android:orientation="horizontal">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<TextView
android:id="@+id/article_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginLeft="32dp"
android:layout_marginRight="32dp"
android:layout_marginTop="8dp"
android:text="Large Text"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textSize="32sp" />
<TextView
android:id="@+id/article_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginLeft="32dp"
android:layout_marginRight="32dp"
android:text="TextView"
android:textSize="16sp"
android:onClick="onClick"
android:clickable="true" />
</LinearLayout>
</ScrollView>
私はscrollviewのテキストが.9.png @drawable/background
の部分をカバーしません気づきました。私はいくつかの背景をテストして、どこにパッチを貼っても、テキストは伸びた部分にしか行きません。私はここに写真をアップロードしました。この場合
、水平パッチは、ほぼ150X150画像の下部にあります。それは1ピクセルオフです。あなたが見ることができるように、テキストビューは一番上の前にいつかは切り取られ、下には1ピクセルのカットオフがあります。
.pngの途中でパッチを作成すると、カットオフが上下に均等に分割されます。同じことを水平に行っていますが、テキストが水平方向にスクロールしないので、見るのがはるかに難しいです。
この現象を取り除くにはどうすればよいですか?私はテキストが.9.png以上の非常に上から下に流れることができるようにしたい。これは可能ですか?もしそうでなければ、私がここに見る唯一の選択肢は、非常に短い狭い9patchにして、それで多くのスペースを取らないようにすることです。私はより良い解決策を望んでいる。
編集:背景画像は、
彼らは、それが一番下に1ピクセル幅の水平パッチを持っていない場合(9patchは、わからないパッチはいえを通じて来る場合)上部にピクセル幅の縦のパッチがあります。スクリーンショットを参照してください。
背景として使用する画像を提供できますか? – Kai
確かに、それを上に加えました。 –
うん、それはN1 Android 2.3.6でどんな間隔も彼女を説明することなく期待通りに動いている。テストしたすべてのデバイスで発生しますか? – Kai