Xamarin:如何在屏幕底部对齐imageview?

时间:2016-01-10 14:43:04

标签: android xamarin imageview scrollview

我已经找到了一些解决方案,但它们似乎都不起作用。 问题是有滚动视图吗? id底栏的imageview需要位于底部。

底部的框架布局和线性布局是我在Stackoverflow上找到的scrollview的解决方案之一,但它也不起作用。

这是我的代码:

<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:fillViewport="true"
    android:background="#FFFFFF">

    <LinearLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="vertical"
        android:id="@+id/linearLayout2">

        <Button
            android:text="Naar volgende stap"
            android:layout_width="1000px"
            android:layout_height="wrap_content"
            android:id="@+id/btn_SecondForm"
            android:layout_marginLeft="130px"
            android:layout_marginTop="150px" 
            android:layout_marginBottom="50px" />

        <FrameLayout
            android:layout_width="fill_parent" 
            android:layout_height="fill_parent"
            android:layout_weight="1">
        </FrameLayout>

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

            <ImageView
                android:layout_width="fill_parent"
                android:layout_height="40px"
                android:id="@+id/bottombar"
                android:src="@drawable/lader" />

        </LinearLayout>

    </LinearLayout>
</ScrollView>

1 个答案:

答案 0 :(得分:0)

 <RelativeLayout>
     <ScrollView
        android:layout_above="@+id/bottom_bar">
     <ImageView
        android:id=@+id/bottom_bar
        android:alignParentBottom="true"/>
 </RelativeLayout>