2017-08-31 10 views
2

Horizo​​ntalScrollViewの右端にある検索ボタンを希望します。
android:layout_alignParentRight = "true"、
を使用しようとしましたが、動作しませんでした どうすればいいですか?
おかげでたくさんHorizo​​ntalScrollViewの右端にFrameLayoutを設定する方法

View

私のXMLコード:

<?xml version="1.0" encoding="utf-8"?> 
<HorizontalScrollView xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:app="http://schemas.android.com/apk/res-auto" 
android:id="@+id/folderPath_horizontalScrollView" 
android:layout_width="match_parent" 
android:layout_height="@dimen/actionbar_height" 
android:fadeScrollbars="false" 
android:fillViewport="true" 
android:scrollbarThumbHorizontal="@drawable/folder_path_scrollbar_thumb" 
android:splitMotionEvents="false"> 

<LinearLayout 
    android:id="@+id/folderPath_folder_path" 
    android:layout_width="wrap_content" 
    android:layout_height="@dimen/actionbar_height" 
    android:gravity="center_vertical" 
    android:orientation="horizontal" 
    android:background="@color/blue_B500" 
    android:splitMotionEvents="false" > 

    <FrameLayout 
     android:id="@+id/chat_search" 
     android:layout_width="@dimen/actionbar_height" 
     android:layout_height="@dimen/actionbar_height" 
     android:background="?actionBarItemBackground"> 

     <View 
      android:layout_width="@dimen/_1dp" 
      android:layout_height="match_parent" 
      android:background="@drawable/divider_line" /> 

     <ImageView 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_gravity="center" 
      android:contentDescription="@string/Common_003" 
      app:srcCompat="@drawable/ic_search" /> 

    </FrameLayout> 
</LinearLayout> 

答えて

0

ことはできませんHorizontalScrollViewへの "右端" がないとして。

HorizontalScrollViewは無限の幅を持っていますので、それほど大きな問題はありません。

あなたが layout_alignParentRightを行うことができますRelativeLayout内 HorizontalScrollView外検索ImageViewのを移動し

関連する問題