在 XML 中将按钮固定在屏幕底部和键盘上非常简单,我们可以这样做
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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:orientation="vertical">
//the ui views
<TableLayout
android:id="@+id/m_table_menu"
style="@style/table_layout_style">
<View style="@style/view_style" />
<TableRow style="@style/table_row_button_style">
//This button sticks to the bottom of the screen or to the keyboard when its open
<Button
android:id="@+id/save_user_name"
style="@style/green_bottom_sticky_button"
android:background="@drawable/green_disabled_ripple_rectangular_button"
android:enabled="false"
android:text="@string/next" />
</TableRow>
</TableLayout>
</RelativeLayout>
我们将如何在 Jetpack compose 中复制它?
答案 0 :(得分:1)
我不确定那个 XML 是如何工作的,因为它没有重力或高度的定义。
但是如果您希望视图始终位于列的底部,您可以制作一个单独的 select
Customer.CustomerID,
Customer.CustomerName,
Customer.CustomerAdress,
format(sum(Orders.Debit-Orders.Credit),'c', 'tr-TR') as Balance
from
Customer
join
Orders on Customer.CustomerID = Orders.CustomerID
and Customer.CustomerName = Orders.CustomerName
group by
Customer.CustomerID,
Customer.CustomerName,
Customer.CustomerAdress
,其中包含您的按钮并提供最大尺寸和 Box
< /p>