每日总结2023-03-26

发布时间 2023-03-26 23:36:31作者: 花伤错零

今天进行了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>
复制代码