每日总结 3.26
今天进行了Android的页面的优化设计,更改结果集的布局高度,使得结果可以全部显示,代码量大概40。
public class MainActivity extends AppCompatActivity { private TextClock tcDateTime; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); tcDateTime = findViewById(R.id.tc_date_time); tcDateTime.setFormat24Hour("yyyy/MM/dd EEEE HH:mm:ss"); }
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:background="@color/white"> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="地铁查询" android:textSize="26sp" android:gravity="center"/> <LinearLayout android:layout_marginLeft="30dp" android:layout_marginRight="30dp" android:layout_width="match_parent" android:layout_height="150dp" android:orientation="vertical"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <Button android:id="@+id/main_xian" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="线路查询" android:textSize="26dp" android:onClick="onclick" android:textColor="@color/black" android:background="#00ff22" tools:ignore="OnClick" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <Button android:id="@+id/main_zhandian" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="站点查询" android:onClick="onclick" android:textSize="26dp" android:textColor="@color/black" android:background="#00ffff" /> </LinearLayout> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <Button android:id="@+id/main_xianlu" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="路线查询" android:textSize="26dp" android:onClick="onclick" android:textColor="@color/black" android:background="#0055ff" /> </LinearLayout> </LinearLayout> <LinearLayout android:layout_width="wrap_content" android:layout_height="100dp"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:textColor="#000000" android:textSize="28sp" android:text="当前时间——"/> <TextClock android:id="@+id/tc_date_time" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:textSize="25sp"/> </LinearLayout> <LinearLayout android:layout_width="wrap_content" android:layout_height="300dp"> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="bottom" android:src="@mipmap/ss"/> </LinearLayout> </LinearLayout>
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· DeepSeek 开源周回顾「GitHub 热点速览」