0

ポートレートモードに最適です。横向きモードにすると、画面の中央にアクティビティが描画され、左右の両方に空白の画面が残ります。マウスをビュー (つまり中央) に置いたままドラッグすると、スクロールが有効になります。空の右側をドラッグするとスクロールしませんか? なぜ ?

取り付け画像

私のレイアウトxmlを投稿する

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical" >

    <ScrollView
        android:id="@+id/enter_pin_scroll"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:scrollbarStyle="outsideOverlay" >

        <RelativeLayout
            android:id="@+id/enter_pin_header_layout"
            android:layout_width="@dimen/pin_inset_region_width"
            android:layout_height="@dimen/pin_inset_region_height"
            android:layout_centerHorizontal="true"
            android:layout_gravity="center_horizontal" >

            <LinearLayout
4

3 に答える 3

0

すべてのビューがScrollViewに保存されている場合は、RelativeLayoutを削除してみませんか?直接持っている:

<ScrollView
    android:id="@+id/enter_pin_scroll"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:scrollbarStyle="outsideOverlay" >

    <RelativeLayout
        android:id="@+id/enter_pin_header_layout"
        android:layout_width="@dimen/pin_inset_region_width"
        android:layout_height="@dimen/pin_inset_region_height"
        android:layout_centerHorizontal="true"
        android:layout_gravity="center_horizontal" >

あなたがそれを維持したい場合:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >

layout_heightをfill_parentに設定します。

于 2012-05-25T17:20:34.790 に答える
0

おそらく、ScrollView の幅が に設定されwrap_contentているため、ダイヤル パッドの外側のタッチ イベントは何の効果もありません。

変更することでこれを修正できます。

<ScrollView 
    android:layout_width="wrap_content" 
    ... />

に、

<ScrollView 
    android:layout_width="match_parent" 
    ... /> 
于 2012-05-25T03:14:51.997 に答える
0

スクロール ビューの幅をfillparentに設定し、コンテンツをラップしないようにします

android:layout_width="fill_parent"
于 2012-05-25T02:25:47.583 に答える