Horizontale Scroll-Blick ins innere LinearLayout - Android

Ich habe eine benutzerdefinierte Liste. Ich bin versucht, um horizontal zu scrollen nur einen spezifischen Teil. Zum Beispiel, in der unten aufgeführten Bild-iam, der versucht, um horizontal zu scrollen, nur die orange box.

Horizontale Scroll-Blick ins innere LinearLayout - Android

Hier ist mein XML-Layout: In der XML-layout der Orange box startet "android:id="@+id/projiziert"

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >

<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="63dp"
    android:layout_marginLeft="0dp"
    android:background="@drawable/bkg_img_fullcell"
    android:orientation="horizontal" >

    <!-- Left Column -->

    <LinearLayout
        android:id="@+id/widget_lineupview_playerdata_container"
        android:layout_width="wrap_content"
        android:layout_height="@dimen/widget_lineup_table_row_height"
        android:layout_toRightOf="@+id/sideView"
        android:gravity="center_vertical"
        android:layout_toLeftOf="@+id/projected"
        android:orientation="vertical" >

        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:weightSum="4" >

            <!-- rel 1 -->

            <LinearLayout
                android:id="@+id/playername1"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="3"
                android:layout_toRightOf="@+id/sideView">

                <com.cbssports.nflapp.ffb.MyTextViewBold
                    android:id="@+id/widget_lineupview_playerdata_playername"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:ellipsize="end"
                    android:inputType="text|textNoSuggestions"
                    android:layout_marginLeft="5dp"
                    android:maxLines="1"
                    android:text=""
                    android:textColor="#08233e"
                    android:textSize="15dp" />


            </LinearLayout>
            <!-- rel 2 -->

            <LinearLayout
                android:id="@+id/widget_lineupview_playerdata_playerStatsIconContainer"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:layout_toRightOf="@+id/playername1"
                android:orientation="horizontal" >

                <ImageView
                    android:id="@+id/widget_lineupview_playerdata_statusIconSuspended"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="1dp"
                    android:src="@drawable/btn_s"
                    android:visibility="gone" />
            </LinearLayout>
 </LinearLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:layout_toRightOf="@+id/sideView" >

            <TextView
                    android:id="@+id/widget_lineupview_playerdata_playerPositionTeam"
                    android:layout_marginLeft="5dp"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:ellipsize="end"
                    android:inputType="text|textNoSuggestions"
                    android:maxLines="1"
                    android:text=""
                    android:textColor="#333333"
                    android:textSize="12dp" />


            <ImageView
                android:id="@+id/widget_lineupview_playerdata_startingPitcherStatus"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="3dp"
                android:layout_marginRight="3dp"
                android:src="@drawable/btn_baseballgraphic"
                android:visibility="gone" />
        </LinearLayout>
    </LinearLayout>

    <LinearLayout
        android:id="@+id/sideView"
        android:layout_width="@dimen/widget_lineup_table_status_column_width"
        android:layout_height="@dimen/widget_lineup_table_row_height"
        android:layout_alignParentLeft="true"
        android:background="@drawable/bkg_img_rosterpos"
        android:gravity="center" >

        <!-- <Button -->
        <com.cbssports.nflapp.ffb.VerticalTextView
            android:id="@+id/widget_lineupview_playerdata_playerStatusButton"
            android:layout_width="21dp"
            android:layout_height="60dp"
            android:layout_margin="0dp"
            android:padding="0dp"
            android:textColor="#004a8e"
            android:textSize="11dp"
            android:textStyle="bold"
            android:gravity="bottom|center" />
    </LinearLayout>
***<LinearLayout
        android:id="@+id/projected"
        android:layout_width="wrap_content"
        android:layout_height="@dimen/widget_lineup_table_row_height"
        android:background="@drawable/bkg_img_whiteoverlay"
        android:layout_toLeftOf="@+id/percentStarted">

        <TextView
            android:id="@+id/widget_lineupview_player_h2h_stats_started_custom"
            android:layout_width="50dp"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:gravity="center"
            android:textStyle="bold"
            android:textSize="16dp"
            android:textColor="#333333" />
    </LinearLayout>
    <LinearLayout
        android:id="@+id/percentStarted"
        android:layout_width="wrap_content"
        android:layout_height="@dimen/widget_lineup_table_row_height"
        android:background="@drawable/bkg_img_whiteoverlay"
         android:layout_alignParentRight="true"
         android:layout_marginLeft="2dp">

        <TextView
            android:id="@+id/widget_lineupview_player_projected_custom"
            android:layout_width="50dp"
            android:layout_height="wrap_content"
            android:layout_centerInParent="true"
            android:gravity="center"
            android:textStyle="bold"
            android:textSize="16dp"
            android:textColor="#333333" />
    </LinearLayout>***
</RelativeLayout>

  • Was ist das problem, außer die 7 Warnungen, können wir sehen, einige Protokolle werden können, oder eine bessere Erklärung?
  • Ich bin versucht, um horizontal zu scrollen die orange box. Stell dir vor, wenn mehr Werte vorhanden. Jetzt bin ich mit zwei. Angenommen, wenn mehr als 5. Ich fügte hinzu, HorizontalScroll Ansicht oben auf <LinearLayout android:id="@+id/prognostiziert, aber sein gibt mir nicht mehr als ein Kind haben Fehler. Nicht sicher, wie es funktioniert.
  • Ok, versuchen Sie Folgendes: Fügen Sie die HorizontalScroll auf der Oberseite des RelativeLayout mit diesem drawable "@drawable/bkg_img_fullcell" und versuchen Sie geben eine einzigartige @+id/ auf jeden Blick, auf verschiedene Sie. Wenn dies nicht funktioniert, versuchen Sie das einwickeln der problematischen Ansichten in einem Layout selbst, so dass die HorizontalView wird nur ein Kind haben.
InformationsquelleAutor dhiku | 2013-03-18
Schreibe einen Kommentar