Android 布局練習

要求:使用多種布局完成以下練習。

1.要求效果 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 完成效果

代碼:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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"
    tools:context="com.example.administrator.myapplication.zuoye728_1Activity"><LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="#beb0b0"
        android:id="@+id/ll1"
        ><TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="請登錄"
            android:textSize="20sp"
            android:gravity="center"
            android:layout_marginTop="20dp"
            android:layout_marginBottom="20dp"
            /></LinearLayout><LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/ll1"
        android:orientation="vertical"
        android:id="@+id/ll2"
        ><LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:clickable="true"
            ><ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@mipmap/xiaoxi"
                android:background="@drawable/zuoye728_1"
                android:layout_gravity="center"
                /><TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="  消息平臺"
                android:textColor="@color/test_bg"
                android:textSize="30sp"
                /></LinearLayout>
<View
    android:layout_width="match_parent"
    android:layout_height="1dp"
    android:background="#beb0b0"
    >
</View></LinearLayout><LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/ll2"
        android:orientation="vertical"
        android:id="@+id/ll3"
        android:clickable="true"
        ><LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            ><ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@mipmap/huodong"
                android:layout_gravity="center"
                android:background="@drawable/zuoye728_2"
                /><TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="  校園活動"
                android:textColor="@color/test_bg"
                android:textSize="30sp"
                /></LinearLayout><View
            android:layout_width="match_parent"
            android:layout_height="1dp"
            android:background="#beb0b0"
            ></View></LinearLayout><LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/ll3"
        android:orientation="vertical"
        android:id="@+id/ll4"
        android:clickable="true"
        ><LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            ><ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@mipmap/sixiang"
                android:layout_gravity="center"
                /><TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="  思想引領"
                android:textColor="@color/test_bg"
                android:textSize="30sp"
                /></LinearLayout><View
            android:layout_width="match_parent"
            android:layout_height="1dp"
            android:background="#beb0b0"
            ></View></LinearLayout><LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/ll4"
        android:orientation="vertical"
        android:id="@+id/ll5"
        android:clickable="true"
        ><LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            ><ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@mipmap/jiuye"
                android:layout_gravity="center"
                /><TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="  就業招聘"
                android:textColor="@color/test_bg"
                android:textSize="30sp"
                /></LinearLayout><View
            android:layout_width="match_parent"
            android:layout_height="1dp"
            android:background="#beb0b0"
            ></View></LinearLayout><LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/ll5"
        android:orientation="vertical"
        android:id="@+id/ll6"
        android:clickable="true"
        ><LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            ><ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@mipmap/kaoyan"
                android:layout_gravity="center"
                /><TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="  考研出國"
                android:textColor="@color/test_bg"
                android:textSize="30sp"
                /></LinearLayout><View
            android:layout_width="match_parent"
            android:layout_height="1dp"
            android:background="#beb0b0"
            ></View></LinearLayout><LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/ll6"
        android:orientation="vertical"
        android:id="@+id/ll7"
        android:clickable="true"
        ><LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            ><ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@mipmap/b"
                android:layout_gravity="center"
                /><TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="  便利工具"
                android:textColor="@color/test_bg"
                android:textSize="30sp"
                /></LinearLayout></LinearLayout></RelativeLayout>
2.完成下圖三個布局。

作業1實際效果:


代碼1:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="match_parent"><LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        ><ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="@mipmap/ic_launcher"
            android:layout_marginTop="20dp"
            /><LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            ><TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="熱門評論"
                android:textColor="#ff0000"
                android:textSize="20sp"
                android:id="@+id/tv1"
                /><TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="HighSmile山人"
                android:textSize="20sp"
                /><TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="丹麥治安一直都很好,這種事情估計可以
                轟動他們全國了"
                android:textColor=""
                /><LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                android:background="#d1c8c8"
                ><ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:src="@mipmap/ic_launcher"
                    /><TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="丹麥連發2起槍擊案致16                    尚不清楚是否相關"
                    android:textColor=""
                    android:layout_gravity="center"
                    /></LinearLayout><LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                ><TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="5小時前"
                    android:layout_marginTop="10dp"
                    /><ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:src="@mipmap/dianzan"
                    android:layout_marginTop="10dp"
                    android:layout_marginLeft="90dp"
                    /><TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="200"
                    android:layout_marginTop="10dp"
                    /><ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:src="@mipmap/pinglun"
                    android:layout_marginTop="6dp"
                    android:layout_marginLeft="10dp"
                    /><TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="1"
                    android:layout_marginTop="10dp"
                    /></LinearLayout><TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="查看1條評論"
                android:textColor="#3a05e9"
                android:background="#d1c8c8"
                /></LinearLayout></LinearLayout>
</LinearLayout>
作業2實際效果:


代碼2:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="match_parent"><LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:background="#f1eaea"
        ><LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            ><LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:orientation="vertical"

                ><LinearLayout
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:orientation="vertical"
                    ><TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginTop="20dp"
                        android:text="春晚五彩:沈騰小品還在"
                        android:textColor=""
                        android:textSize="20sp"
                        /><TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="修改"
                        android:textColor=""
                        android:textSize="20sp"
                        /></LinearLayout><TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="20dp"
                    android:text="新浪娛樂  評論  220"
                    /></LinearLayout></LinearLayout><ImageView
            android:layout_width="100dp"
            android:layout_height="100dp"
            android:src="@mipmap/ic_launcher"
            android:layout_marginLeft="40dp"
            /></LinearLayout>
</LinearLayout>
作業3實際效果:

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/542819.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/542819.shtml
英文地址,請注明出處:http://en.pswp.cn/news/542819.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

有危害嗎_涂料漆對身體有害嗎?涂料漆危害怎么預防

目前很多人都會通過涂料漆來進行墻面裝飾&#xff0c;用它來對墻面進行裝飾是可以馬上的改善墻壁的狀態&#xff0c;但有些人也擔心它會對身體有害&#xff0c;涂料漆對身體有害嗎?由于擔心涂料漆會給健康帶來危害&#xff0c;很多人都想要預防&#xff0c;那涂料漆危害怎么預…

小寫大寫轉換_小寫到大寫轉換器JavaScript工具| 網絡應用項目

小寫大寫轉換Hi! At times, beginners always find it hard getting the application of the theory they learn in programming or a particular language. 嗨&#xff01; 有時&#xff0c;初學者總是很??難在編程或特定語言中應用他們學到的理論。 In this article, well…

inventor扳手制作視頻_弱電工程視頻監控系統施工方案,可作施工組織設計

1 工程概況 1.1 編制《工程總體實施方案》 主要包括&#xff1a;結合高清監控系統設計方案作配套的深化設計&#xff0c;編制高清監控系統實施計劃&#xff0c;并提出相關的配合要求。根據總體方案&#xff0c;對高清監控系統工程的技術設計作必要的補充。并提出相關的實施技術…

python print與input

python基礎語法1print()函數input()函數print()函數 不用引號&#xff0c;函數內為數字或數字運算 單引號&#xff0c;整條語句結構&#xff0c;’\n’ 雙引號&#xff0c;函數結構 三引號&#xff0c;對內容進行換行輸出 print("let is go")#函數結構 print(let i…

lol最克制諾手的英雄_LOL:究竟有沒有完美克制諾手的英雄?時光上單或可一戰?...

小伙伴們大家好&#xff0c;我是小數點。諾克薩斯之手德萊厄斯&#xff0c;他可以說是每一位上單玩家的噩夢了&#xff0c;因為喜歡玩諾手的人特別多&#xff0c;而會玩的諾手卻一般都在對面。要知道諾手這樣英雄拿到優勢兇起來&#xff0c;你就沒得打了&#xff0c;就算在塔下…

Oracle 創建表空間,用戶,賦值(簡裝)

一&#xff0c;1.Oracle 創建表空間&#xff0c;用戶&#xff0c;賦值&#xff08;簡裝&#xff09;C:\Documents and Settings\Administrator>sqlplus /nologSQL> conn /as sysdba2.刪除用戶drop user username cascade;3.創建自增表表空間SQL> create tablespace 表…

編程語言難度排名_編程語言TOP10!該如何選擇適合自己的?

本文轉載自公眾號“讀芯術”(ID&#xff1a;AI_Discovery)編程領域大約有700種代碼語言。理解編程語言的重要性以及其如何影響需要執行的具體任務至關重要。一篇文章窮盡700 種語言不現實&#xff0c;也沒有意義。因此&#xff0c;筆者挑選出了時下最熱門的原因&#xff0c;在本…

測試私有方法 重構_一個全棧工程師重構之路:中小公司 DevOps 落地實踐

為了這篇文章&#xff0c;我前后寫了將近十篇文章鋪墊&#xff0c;才將這篇整體重構思想引出。背景先說下背景&#xff0c;我們是一家小公司&#xff0c;雖然打著做產品的旗幟&#xff0c;但是每個客戶都有大量的個性化功能&#xff0c;這里指各個客戶的java端、Android端、ios…

python變量 數據類型 列表 元組 字典

python基礎語法2變量數據類型與類型轉換列表添加列表元素修改元素刪除列表元素組織列表創建數值列表操作列表元組元組轉列表字典創建字典列表取值字典刪除增加修改變量 變量命名要求&#xff1a; 1.只能是一個詞 2.只能包含字母、數字、下劃線 3.不能用數字開頭 變量定義位置不…

HDU 5777 domino

貪心一下。有k次機會&#xff0c;也就是那些數字中&#xff0c;最大的k-1可以不選擇。答案為&#xff1a;sum{a[i]}-sum{最大的k-1個a[i]}n。注意&#xff1a;k>n的時候直接輸出n。 #pragma comment(linker, "/STACK:1024000000,1024000000") #include<cstdio&…

puppeteer執行js_使用Node.js和Puppeteer與表單和網頁進行交互– 2

puppeteer執行jsHi guys! Today lets look at another powerful function of the puppeteer API using Node.js part 2. 嗨&#xff0c;大家好&#xff01; 今天&#xff0c;讓我們看看使用Node.js第2部分的puppeteer API的另一個強大功能。 In the first part of this sectio…

好用的平板電腦_小熊分享|這五款平板電腦的性價比絕了!

【葉紫網】獨樂樂不如眾樂樂&#xff0c;點擊上方頭像并添加關注&#xff0c;與葉紫科技小熊一起探索科技的奧秘。要說當代年輕人的消費觀&#xff0c;我們也是說要該花花&#xff0c;該省省&#xff0c;像現在的科技產品更新換代的速度&#xff0c;就算我們的荷包相當的鼓&…

python if語句 for語句 while語句

python基礎語法3if語句for循環while循環else語句退出循環if語句 執行條件判斷&#xff0c;符合執行if內語句&#xff0c;否則執行elif或者else。 if、elif、else都要接冒號&#xff0c;注意縮進 各級條件互斥 后面的條件可以接列表&#xff0c;表示或關系 contribution860 if…

交際過程的兩個基本環節_跨文化交際學概論筆記(二)

第二部分 基本概念&#xff1a;文化與交際第一章 文化的定義與特征一、文化的定義1. 文化的定義為何重要首先&#xff0c;在跨文化交際學中文化是一個至關重要的問題。研究時&#xff0c;不可避免進行文化對比。其次&#xff0c;在研究任何學科前&#xff0c;術語的界定是前提。…

Python中列表的del,remove和pop函數之間的區別

1)Python del函數 (1) Python del function) del is nothing but "delete". del is a keyword which basically goes on the position given by the user in del(position) and deletes that element and also changes the positions of all the other elements as i…

lcd圖片轉二進制工具_遼寧2.8寸LCD屏價格,測距儀LCD顯示屏_思邁微

首頁 > 新聞中心發布時間&#xff1a;2020-11-15 08:27:09 導讀&#xff1a;思邁微為您提供遼寧寸LCD屏價格,測距儀LCD顯示屏的相關知識與詳情&#xff1a; 以上便是對LED點陣式顯示屏的軟硬件系統、組成等的技術知識的粗略的介紹。以這款名為《液晶顯示器亮點壞點修復工具》…

python 布爾值 布爾運算 運算符

python基礎語法4布爾值布爾運算運算符算術運算符賦值運算符比較運算符邏輯運算符布爾值 布爾值&#xff1a;Ture&#xff08;真&#xff09; Flase&#xff08;假&#xff09; 假&#xff1a;Flase、0、’’&#xff08;空字符串&#xff09;、[]&#xff08;空列表&#xff0…

python代碼安全性問題_這個python代碼對注入安全嗎?

我在Python中有一個服務器/客戶機套接字對。服務器接收特定的命令&#xff0c;然后準備響應并將其發送到客戶端。在在這個問題中&#xff0c;我關心的只是代碼中的可能的注入&#xff1a;如果可以要求服務器對第二個參數做一些奇怪的事情——如果對命令內容的控制不足以避免不希…

Python | 使用+ =運算符在字符串末尾附加文本

Given a string, and we have to append more string (text) at the end of the string using operator in Python. 給定一個字符串&#xff0c;我們必須在Python中使用 運算符在字符串的末尾附加更多字符串(文本)。 There are two methods to add string (text) at the end …

ps如何修改圖片大小尺寸_PS新手入門教程:學習如何修改畫布的大小

PS新手入門教程&#xff1a;學習如何修改畫布的大小。在photoshop中&#xff0c;可以把畫布理解為一張白紙&#xff0c;而我們要處理的圖像可以理解為這張白紙表面上的畫。我們修改畫布的大小時&#xff0c;圖像并不會隨著畫布的大小而整體變大或縮小&#xff0c;這是修改畫布大…