Android设置片段下方元素的位置

时间:2014-07-08 12:09:21

标签: android android-activity android-fragments position

我有RelativeLayout个活动。我有一个片段的另一种布局。片段布局以编程方式添加到活动中。在活动的RelativeLayout中,有一个LinearLayout,其中包含三个按钮。如何将LinearLayout的位置设置在片段下(在y边缘)而不在活动xml中包含片段?

这是活动XML结构:

<RelativeLayout 
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"

    <LinearLayout
         >

        <Button
             />

        <Button
            />

        <Button
            />
    </LinearLayout>

 </RelativeLayout>  

1 个答案:

答案 0 :(得分:0)

尝试将您的布局带到前面这篇文章可以帮助您:  Defining Z order of views of RelativeLayout in Android

和android文档: http://developer.android.com/reference/android/view/View.html#bringToFront()