当前位置: 移动技术网 > 移动技术>移动开发>Android > 使用XML布局文件控制UI界面

使用XML布局文件控制UI界面

2020年07月23日  | 移动技术网移动技术  | 我要评论

activity_main.xml中代码

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@mipmap/bg"
    tools:context=".MainActivity">

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:textSize="20sp"
        android:textColor="#115572"
        android:text="@string/start"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

</FrameLayout>

strings.xml中代码:

<resources>
    <string name="app_name">桌面台球</string>
    <string name="start">开始游戏</string>
</resources>

本文地址:https://blog.csdn.net/weixin_44915319/article/details/107518261

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网