Mono xamarin android活动中的底部按钮未显示
我想在屏幕底部添加btton(按钮1),无论scrollview中有多少数据,它都将始终显示。 我的按钮1未显示在屏幕底部。 谁知道,我错在哪里Mono xamarin android活动中的底部按钮未显示,mono,xamarin,xamarin.android,xamarin-studio,Mono,Xamarin,Xamarin.android,Xamarin Studio,我想在屏幕底部添加btton(按钮1),无论scrollview中有多少数据,它都将始终显示。 我的按钮1未显示在屏幕底部。 谁知道,我错在哪里 <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#ffffffff">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="center">
<TextView
android:text="Step 1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/step1TextView"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:textStyle="normal"
android:textColor="#ff000000"
android:layout_alignParentLeft="true" />
<TextView
android:text="Step 2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/step2TextView"
android:textStyle="bold"
android:textColor="#ff000000"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="10dp"
android:layout_toRightOf="@+id/step1TextView"
android:gravity="center" />
<TextView
android:text="Step 3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/step3TextView"
android:textStyle="normal"
android:textColor="#ff000000"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:layout_gravity="center_horizontal"
android:layout_toRightOf="@+id/step2TextView"
android:layout_alignParentRight="true"
android:layout_alignWithParentIfMissing="true" />
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#ffffffff"
android:layout_below="@+id/step1TextView">
<RelativeLayout
android:id="@+id/highlightFooter1Layout"
android:layout_width="fill_parent"
android:layout_height="10dp"
android:background="#ffffffff">
<LinearLayout
android:id="@+id/highlightFooter11Layout"
android:layout_width="2dp"
android:layout_height="70dp"
android:background="#ffe9e9e9"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp" />
<LinearLayout
android:id="@+id/highlightFooter12Layout"
android:layout_width="2dp"
android:layout_height="70dp"
android:background="#000000"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp"
android:layout_toRightOf="@+id/highlightFooter11Layout" />
<LinearLayout
android:id="@+id/highlightFooter13Layout"
android:layout_width="2dp"
android:layout_height="70dp"
android:background="#ffe9e9e9"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp"
android:layout_toRightOf="@+id/highlightFooter12Layout" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/highlightFooter2Layout"
android:layout_width="fill_parent"
android:layout_height="10dp"
android:background="#ffe9e9e9"
android:layout_below="@+id/highlightFooter1Layout">
<LinearLayout
android:id="@+id/highlightFooter21Layout"
android:layout_width="50dp"
android:layout_height="5dp"
android:background="#ffff8b03"
android:layout_alignParentTop="true"
android:layout_marginLeft="65dp" />
</RelativeLayout>
</RelativeLayout>
</RelativeLayout>
<ScrollView
android:id="@+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:text="Your phone number has been successfully verified . Please enter the following details to begin."
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/textView1"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:layout_marginRight="10dp"
android:background="#ffffffff"
android:textColor="#ff000000" />
<Spinner
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/stateSpinner"
android:background="#ffe9e9e9"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="10dp"
android:layout_weight="1" />
<Spinner
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/districtSpinner"
android:background="#ffe9e9e9"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="10dp"
android:layout_weight="1" />
<Spinner
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/constSpinner"
android:background="#ffe9e9e9"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="10dp"
android:layout_weight="1" />
<EditText
android:inputType="number"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/editText1"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="10dp"
android:background="#ffe9e9e9" />
<ImageView
android:src="@android:drawable/ic_menu_gallery"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/imageView1" />
<TextView
android:text="Chief Minister"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/cmTextView"
android:gravity="center" />
<TextView
android:text="cm name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/cmNametextView"
android:gravity="center"
android:textColor="#ffff8b03" />
<TextView
android:text="Member of Parliament"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/mpTextView"
android:gravity="center" />
<TextView
android:text="mp name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/mpNameTextView"
android:gravity="center"
android:textColor="#ffff8b03" />
<TextView
android:text="Member of Legislative Assembly"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/mlaTextView"
android:gravity="center" />
<TextView
android:text="mla name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/mlaNameTextView"
android:gravity="center"
android:textColor="#ffff8b03" />
</LinearLayout>
</ScrollView>
<LinearLayout
android:id="@+id/buttonLayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1">
<Button
android:text="Next"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/button1"
android:layout_gravity="bottom"
android:autoText="false"
android:layout_weight="1"
android:layout_marginLeft="0dp"
android:layout_marginTop="0dp"
android:layout_marginRight="0dp"
android:layout_marginBottom="0dp"
android:background="#ffff8b03"
android:textStyle="bold"
android:textColor="#ffffffff"
android:textSize="20dp"
android:minHeight="50dp"
android:maxHeight="50dp" />
</LinearLayout>
正如Casper建议的那样,在xml末尾添加
,然后添加android:layout\u weight=“1”
发送给您滚动视图
并用您的按钮将其从线性布局
中删除。至少在xml末尾添加以关闭它:)如果这没有帮助,我将开始逐个删除每个布局。抱歉@Casper Skoubo,你的评论对我来说很有用,但我错把你的评论投了一票。我非常抱歉。没问题,你把它修好了,所以这对我来说很酷:)@Casper Skoubo非常感谢你