(androis studio)app连连看demo练习

.xml 文件

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_gravity="center"
    android:background="@drawable/animal_bg"
    android:orientation="vertical"
    android:paddingLeft="15dp"
    android:paddingRight="15dp">

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:layout_marginTop="200dp"
        android:orientation="20">

        <Button
            style="@style/btnStyle"
            android:layout_width="70dp"
            android:background="@drawable/three" />

        <Button
            style="@style/btnStyle"
            android:background="@drawable/four" />

        <Button
            style="@style/btnStyle"
            android:background="@drawable/box" />

        <Button
            style="@style/btnStyle"
            android:background="@drawable/five" />
    </LinearLayout>

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:layout_marginTop="15dp"
        android:orientation="horizontal">


        <Button
            style="@style/btnStyle"
            android:layout_width="70dp"
            android:background="@drawable/one" />

        <Button
            style="@style/btnStyle"
            android:background="@drawable/two" />

        <Button
            style="@style/btnStyle"
            android:background="@drawable/box" />

        <Button
            style="@style/btnStyle"
            android:background="@drawable/four" />
    </LinearLayout>

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:layout_marginTop="15dp"
        android:orientation="horizontal">

        <Button
            style="@style/btnStyle"
            android:layout_width="70dp"
            android:background="@drawable/five" />

        <Button
            style="@style/btnStyle"
            android:background="@drawable/box" />

        <Button
            style="@style/btnStyle"
            android:background="@drawable/three" />

        <Button
            style="@style/btnStyle"
            android:background="@drawable/two" />
    </LinearLayout>


</LinearLayout>

.style样式文件

<resources>

     Base application theme.
    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
    </style>

    <style name="btnStyle">
        <item name="android:layout_width">70dp</item>
        <item name="android:layout_height">70dp</item>
        <item name="android:layout_marginRight">15dp</item>
    </style>

</resources>

结果图:在这里插入图片描述

*后期会逐步更新练练看逻辑代码…(敬请期待。。。)

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

银河流浪家007

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值