android学习日志

1.分析界面
在这里插入图片描述
由以上及部分组成,在一个大框架中使用几个小框架,再在小框架中插入图片,实现图片显现。
使用代码如下:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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="@drawable/index_bg"
    android:orientation="vertical"
    android:gravity="center_horizontal"
    tools:context=".MainActivity">

    <LinearLayout
        android:layout_width="360dp"
        android:layout_height="30dp"
        android:layout_marginTop="190dp"
        android:layout_gravity="center"
        android:alpha="0.8"
        android:gravity="center">
        <TextView
            android:layout_width="180dp"
            android:layout_height="30dp"
            android:textColor="#000066"
            android:text="部队管理"
            android:layout_marginLeft="1dp"
            android:gravity="center"
            android:background="@color/white"
            android:layout_gravity="left"/>

        <TextView
            android:layout_width="180dp"
            android:layout_height="30dp"
            android:background="@color/cardview_dark_background"
            android:textColor="@color/white"
            android:gravity="center"
            android:text="灭火救援"
            android:layout_gravity="center"/>
    </LinearLayout>

    <LinearLayout
        android:layout_width="10dp"
        android:layout_height="9dp"
        android:layout_gravity="center_vertical"
        android:layout_marginLeft="300dp"
        android:background="@drawable/logo" />

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:layout_marginTop="10dp"
        android:background="@drawable/list_bg">

        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@drawable/list_logo"
            android:layout_marginRight="-100dp"/>
    </LinearLayout>
    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:layout_marginTop="10dp"
        android:background="@drawable/list_bg2">
        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@drawable/list_logo2"
            android:layout_marginRight="-100dp"/>
    </LinearLayout>
    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:layout_marginTop="10dp"
        android:background="@drawable/list_bg3">
        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@drawable/list_logo3"
            android:layout_marginRight="-100dp"/>
    </LinearLayout>
    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:layout_marginTop="10dp"
        android:background="@drawable/list_bg4">
        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@drawable/list_logo4"
            android:layout_marginRight="-100dp"/>
    </LinearLayout>
    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:layout_marginTop="10dp"
        android:background="@drawable/list_bg5">
        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="@drawable/list_logo5"
            android:layout_marginRight="-100dp"/>
    </LinearLayout>
    <LinearLayout
        android:layout_width="405dp"
        android:layout_height="40dp"
        android:background="@color/white"
        android:gravity="top"
        android:layout_marginTop="50dp"
        >
        <LinearLayout
            android:layout_width="135dp"
            android:layout_height="20dp"
            android:gravity="center"
            >
            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:src="@drawable/logo1"/>
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="首页"/>
        </LinearLayout>
        <LinearLayout
            android:layout_width="135dp"
            android:layout_height="20dp"
            android:gravity="center"
            >
            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:src="@drawable/logo2"/>
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="消息"/>
        </LinearLayout>
        <LinearLayout
            android:layout_width="135dp"
            android:layout_height="20dp"
            android:gravity="center"
            >
            <ImageView
                android:layout_width="21dp"
                android:layout_height="20dp"
                android:layout_gravity="center"
                android:src="@drawable/logo3"/>
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="个人中心"/>
        </LinearLayout>
    </LinearLayout>


</LinearLayout>

设计界面如下图
在这里插入图片描述
使用首页同样的样式,进行修改便可以。
在第一次出现的问题,还没有解决,在百度搜索不到该问题,根据运行错误的提示,寻找什么位置出问题,再去问同学相同位置下的配置是否一样,没有出现问题,便进行修改。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值