在布局的中心|添加静态按钮

时间:2018-12-18 21:28:21

标签: android

我正在尝试在布局的中心|底部添加一个静态按钮 附言:我需要卡片视图。

这是代码:Invalid database URL syntax: jdbc:db2://localhost:55555/FOLDER:currentSchema=ASCHEMA;currentFunctionPath=ASCHEMA. ERRORCODE=-4461, SQLSTATE=42815 在这里输入代码 在这里输入代码<?xml version="1.0" encoding="utf-8"?> 在这里输入代码<android.support.v7.widget.CardView 在这里输入代码android:layout_height="wrap_content" 在这里输入代码{{ 1}}在此处输入代码android:layout_width="match_parent" enter code here`android:layout_height =“ match_parent”>

<RelativeLayout

2 个答案:

答案 0 :(得分:0)

您可以在RelativeLayout中的按钮上使用layout_alignParentBottomlayout_centerHorizontal来实现此目的,就像这样:

<Button
    android:layout_width="wrap_content"
    android:layout_height="wrap_content
    android:layout_alignParentBottom="true"
    android:layout_centerHorizontal="true"
    android:text="CLICK ME"
 />

答案 1 :(得分:0)

如果您希望在整个“回收者”视图中使用1个按钮,则可以将其创建为具有不同项目类型/视图持有人的单独项目。

相关问题