我有一个自定义列表。我正在尝试仅水平滚动特定部分。例如,在下图中,我试图仅水平滚动橙色框。
这是我的 XML 布局:在 XML 布局中,橙色框开始“android:id="@+id/projected"
<?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>