2017-10-02 16 views
-3

このレイアウトのように[次へ]ボタン(アイコン)が真ん中になりたい:ここ私は、私は少し問題が抱えている

は私のコードです:

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout 
xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:app="http://schemas.android.com/apk/res-auto" 
xmlns:tools="http://schemas.android.com/tools" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:background="@drawable/back_ground_evoll" 
android:paddingBottom="@dimen/activity_vertical_margin" 
android:paddingLeft="@dimen/activity_horizontal_margin" 
android:paddingRight="@dimen/activity_horizontal_margin" 
android:paddingTop="@dimen/activity_vertical_margin" 


<LinearLayout 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical" 
    android:weightSum="10"> 

    <TextView 
     android:layout_width="match_parent" 
     android:layout_height="0dp" 
     android:layout_weight="1" 
     android:gravity="center" 
     android:text="@string/personal_info" 
     android:textColor="#fff" 
     android:textSize="20sp" /> 




    </RelativeLayout> 
</LinearLayout> </RelativeLayout> 

、ここでは私のレイアウトです:

私は[次へ]ボタンは、このレイアウトのように真ん中になりたい:

+0

に基づいてビューを配置この方法は、 'FrameLayout' –

+1

フレームレイアウトは、他のソリューションを動作しませんでしたを使用してみてください? – tamtam29

+0

''の前に余分な ''を持ってきたのはなぜですか? – Dijkgraaf

答えて

0

あなたはCoordinatorLayout

を使用することができます
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    android:layout_width="match_parent" android:layout_height="match_parent"> 

    <View android:id="@+id/your_white_layout" 
     android:layout_width="match_parent" android:layout_height="@dimen/layout_height"/> 

    <View android:id="@+id/the_layout_with_the next_button" 
     android:layout_width="@dimen/width" android:layout_height="@dimen/height" 
     app:layout_anchor="@id/your_white_layout" 
     app:layout_anchorGravity="bottom|center"/> 

</android.support.design.widget.CoordinatorLayout> 

あなたがアンカー

関連する問題