Java 无法在线性布局(Xamarin.Android)中更改页面底部的按钮
我无法将按钮置于屏幕底部。列表视图应位于顶部,而注销按钮必须在列表视图结束后出现在底部Java 无法在线性布局(Xamarin.Android)中更改页面底部的按钮,java,c#,android,xamarin,Java,C#,Android,Xamarin,我无法将按钮置于屏幕底部。列表视图应位于顶部,而注销按钮必须在列表视图结束后出现在底部 <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_hei
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="top"
android:background="#29A586">
<Button
android:text="Sign Out"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/SignOutButton" />
<ListView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/mylistView" />
</LinearLayout>
使用具有权重的listview下面的按钮
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="top"
android:background="#29A586">
<ListView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:id="@+id/mylistView" />
<Button
android:text="Sign Out"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/SignOutButton" />
</LinearLayout>
你试过把按钮放在列表视图下面吗?你能添加一个屏幕截图吗?@haldo我按照穆罕默德·伊姆兰在回答中的建议做了。但当我导航到该屏幕时,应用程序正在崩溃。嘿,穆罕默德,它在XAML designer中正确呈现,但当我导航到该屏幕时,应用程序正在崩溃。@NIshank我不知道为什么它会崩溃,但xml会正常工作,bcz我测试它。。在此处共享您的崩溃Getting=>Android.Views.InflateException:每当我导航到该屏幕时。@NIshank也检查一下