政策查询系统(安卓)6

编写安卓的界面

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bg">

<!-- 使用垂直线性布局 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
<!-- 标题 -->
<TextView
android:id="@+id/TitleText"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="15dp"
android:text="科技政策一点通"
android:gravity="center"
android:textStyle="italic"
android:textColor="@color/white"
android:textSize="30sp" />
<!-- 按钮区域 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<!-- 政策分类按钮 -->
<Button
android:id="@+id/categoryButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_margin="10dp"
android:padding="6dp"
android:text="政策分类"
android:textColor="@color/black"
android:textSize="24sp"
android:background="@drawable/translucent_button" />
<!-- 政策概览按钮 -->
<Button
android:id="@+id/overviewButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_margin="10dp"
android:padding="6dp"
android:text="政策查询"
android:textColor="@color/black"
android:textSize="24sp"
android:background="@drawable/translucent_button" />
</LinearLayout>
<!-- 政策概览界面 -->
<LinearLayout
android:id="@+id/LL1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:visibility="visible">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<!-- 输入框 -->
<AutoCompleteTextView
android:id="@+id/searchInput"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:hint="请输入政策关键词"
android:padding="10dp"
android:textSize="24sp"
android:background="@drawable/translucent_edit"
android:completionThreshold="1" />
<!-- 查询按钮 -->
<Button
android:id="@+id/searchButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:padding="6dp"
android:text="查询"
android:textColor="@color/black"
android:textSize="24sp"
android:background="@drawable/translucent_button" />
</LinearLayout>
<!-- 政策名称列表 -->
<ListView
android:id="@+id/policyListView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="15dp"
android:textSize="18sp"
/>
</LinearLayout>
<!-- 政策分类界面 -->
<LinearLayout
android:id="@+id/LL2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:visibility="gone">
</LinearLayout>
<!-- 查询内容展示界面,包装在 ScrollView 中 -->
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/resultTextView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="0dp"
android:padding="0dp"
android:textColor="#000000"
android:textSize="20sp" />
<!-- 显示查询结果的 TextView -->
<TextView
android:id="@+id/resultTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:padding="5dp"
android:textColor="#000000"
android:textSize="20sp"/>
</LinearLayout>
</ScrollView>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">

<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="16dp">

<TextView
android:id="@+id/policyDetailTextView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="16sp" />
</LinearLayout>
</ScrollView>
</androidx.constraintlayout.widget.ConstraintLayout>
posted @   平安喜乐×  阅读(7)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 单线程的Redis速度为什么快?
· 展开说说关于C#中ORM框架的用法!
· Pantheons:用 TypeScript 打造主流大模型对话的一站式集成库
· SQL Server 2025 AI相关能力初探
· 为什么 退出登录 或 修改密码 无法使 token 失效
点击右上角即可分享
微信分享提示