主頁 > 移動端開發 > 15天快速入門安卓開發(三) 布局知識

15天快速入門安卓開發(三) 布局知識

2021-07-28 17:09:59 移動端開發

文章目錄

    • 三 布局知識
      • 3.1 布局理論
      • 3.2 線性布局LinearLayout
      • 3.3 幀布局FrameLayout
      • 3.4 相對布局 RelativeLayout
      • 3.5 表格布局TableLayout
      • 3.6 網格布局GridLayout
      • 3.7 百分比布局(PercentRelativeLayout、PercentFrameLayout)
      • 3.8 常用的控制元件
      • 3.9 主題切換
      • 3.10 Android中的單位
      • 3.11 綜合練習

三 布局知識

關于布局有多樣式,同一個uI布局可能有多方式來實作,因此我們關注的是功能的實作,而不是布局的使用,適合自己是最好的,不必糾結,

UI組件:https://qmuiteam.com/android

圖示網站:https://www.iconfont.cn/

圖片網站:https://www.logosc.cn/so/s%E5%9B%A2%E9%98%9F

3.1 布局理論

在這里插入圖片描述

View

  • ViewAndroid中可以理解為視圖,它占據螢屏上的一塊矩形區域,負責提供 組件繪制和事件處理的方法,
  • View類是所有的widgets組件的基類,
  • View類位于android.view包中;View類的子類一般都位于android.widget包中,

viewGroup

  • ViewGroup在Android中可以理解為容器,

  • ViewGroup類繼承自View類,它是View類的擴 展,是用來容納其他組件的容器;

  • ViewGroup是一個抽象類,在實際應用中使用ViewGroup的子類來作為容器的,

  • ViewGroup.MarginLayoutParamsViewGroup.LayoutParams

  • ViewGroup是一個抽象類,也是其他容器類的基類,它的一些實作類有: LinearLayout(線性布局)RelativeLayout(相對布局)TableLayout(表格布局) FrameLayout(幀布局),AbsoluteLayout(絕對布局),GridLayout(網格布局)

Padding和Margins

  • Padding:在View的頂部、底部、左側和右側的填充像素,也稱為內邊距, 它設定的是內容與View邊緣的距離,Padding將占據View的寬度和高度, 設定指定的內邊距后,視圖內容將偏離View邊緣指定的距離,
  • Margins:組件的頂部、底部、左側和右側的空白區域,稱為外邊距,它 設定的是組件與其父容器的距離,Margins不占據組件的寬度和高度,為 組件設定外邊距后,該組件將遠離父容器指定的距離,如果還有相鄰組件, 那么也將遠離其相鄰組件指定距離

3.2 線性布局LinearLayout

常用屬性

在這里插入圖片描述

android:gravity:是對view控制元件本身來說的,是用來設定view本身的內容 應該顯示在view的什么位置,默認值是左側

android:layout_gravity:是相對于包含該元素的父元素來說的,設定該元 素在父元素的什么位置

<?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:id="@+id/LinearLayout1"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal">

    <EditText
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:hint="@string/app_edit"
        android:layout_weight="1"/>

    <Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/app_button"
        android:onClick="go"
         />
</LinearLayout>

權重 用來等比例劃分(weight

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"    
    xmlns:tools="http://schemas.android.com/tools"    
    android:id="@+id/LinearLayout1"    
    android:layout_width="match_parent"    
    android:layout_height="match_parent"    
    android:orientation="horizontal">    
    <LinearLayout    
        android:layout_width="0dp"    
        android:layout_height="fill_parent"    
        android:background="#ADFF2F"     
        android:layout_weight="1"/>    

    <LinearLayout    
        android:layout_width="0dp"    
        android:layout_height="fill_parent"    
        android:background="#DA70D6"     
        android:layout_weight="2"/>    

</LinearLayout>  

3.3 幀布局FrameLayout

FrameLayout(幀布局)可以說是六大布局中最為簡單的一個布局,這個布局直接在螢屏上開辟出一塊空白的區域,當我們往里面添加控制元件的時候,會默認把他們放到這塊區域的左上角,

  • android:foreground:設定改幀布局容器的前景影像
  • android:foregroundGravity:設定前景影像顯示的位置
  • ScrollViewHorizontalScrollView,分別支持視圖的垂直滾動和水平滾動,
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/FrameLayout1"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity"
    android:foreground="@drawable/logo"
    android:foregroundGravity="right|bottom">

    <TextView
        android:layout_width="200dp"
        android:layout_height="200dp"
        android:background="#FF6143" />
    <TextView
        android:layout_width="150dp"
        android:layout_height="150dp"
        android:background="#7BFE00" />
    <TextView
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:background="#FFFF00" />

</FrameLayout>

3.4 相對布局 RelativeLayout

  • 通過指定界面元素與其他元素的相對位置關系,確定界面中所有元素的布 局位置
  • 特點:靈活,最大程度保證在各種螢屏型別的手機上正確顯示
  • 在眾多布局中,推薦使用相對布局

父容器布局

在這里插入圖片描述

在這里插入圖片描述

控制元件布局

在這里插入圖片描述

在這里插入圖片描述

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    xmlns:android="http://schemas.android.com/apk/res/android">

    <TextView
        android:id="@+id/text"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="這是已知控制元件"
        android:textColor="#E30808"
        />
    <EditText
        android:id="@+id/text2"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="這是文本編輯框"
        android:layout_below="@+id/text"
        />
    
    <Button
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="登錄"
        android:layout_below="@+id/text2"
        />

</RelativeLayout>

3.5 表格布局TableLayout

TableLayout的用法還是很簡單的,無非就是確定表格的行數,以及使用 那三個屬性來設定每一行中的第某列的元素隱藏,拉伸,或者收縮即可!

  • android:collapseColumns:設定需要被隱藏的列的序號
  • android:shrinkColumns:設定允許被收縮的列的列序號
  • android:stretchColumns:設定運行被拉伸的列的列序號
  • 以上這三個屬性的列號都是從0開始算的,比如shrinkColunmns = “2”,對應的是第三列!
<TableLayout    
    android:id="@+id/TableLayout2"    
    android:layout_width="fill_parent"    
    android:layout_height="wrap_content"    
    android:stretchColumns="1"
             
             >    

    <TableRow>    

        <Button    
            android:layout_width="wrap_content"    
            android:layout_height="wrap_content"    
            android:text="one" />    

        <Button    
            android:layout_width="wrap_content"    
            android:layout_height="wrap_content"    
            android:text="two" />    

        <Button    
            android:layout_width="wrap_content"    
            android:layout_height="wrap_content"    
            android:text="three" />    

        <Button    
            android:layout_width="wrap_content"    
            android:layout_height="wrap_content"    
            android:text="four" />                 
    </TableRow>    
</TableLayout>  

3.6 網格布局GridLayout

網格布局(GridLayout)與表格布局相似,用 一組無限細的直線將界面分割成行、列、單 元,然后,指定控制元件顯示的區域和控制元件在該 區域的顯示方式,網格布局實作了控制元件的交 錯顯示,避免使用布局嵌套,更有利于自由 編輯布局的開發,

  • 可以自己設定布局中組件的排列方式
  • 可以自定義網格布局有多少行,多少列
  • 可以直接設定組件位于某行某列
  • 可以設定組件橫跨幾行或者幾列

在這里插入圖片描述

<GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/GridLayout1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:columnCount="4"
    android:orientation="horizontal"
    android:rowCount="6" >

    <TextView
        android:layout_columnSpan="4"
        android:layout_gravity="fill"
        android:layout_marginLeft="5dp"
        android:layout_marginRight="5dp"
        android:background="#FFCCCC"
        android:text="0"
        android:textSize="50sp" />

    <Button
        android:layout_columnSpan="2"
        android:layout_gravity="fill"
        android:text="回退" />

    <Button
        android:layout_columnSpan="2"
        android:layout_gravity="fill"
        android:text="清空" />

    <Button android:text="+" />

    <Button android:text="1" />

    <Button android:text="2" />

    <Button android:text="3" />

    <Button android:text="-" />

    <Button android:text="4" />

    <Button android:text="5" />

    <Button android:text="6" />

    <Button android:text="*" />

    <Button android:text="7" />

    <Button android:text="8" />

    <Button android:text="9" />

    <Button android:text="/" />

    <Button
        android:layout_width="wrap_content"
        android:text="." />

    <Button android:text="0" />

    <Button android:text="=" />

</GridLayout> 

3.7 百分比布局(PercentRelativeLayout、PercentFrameLayout)

Android引入了一種全新的布局方式來解決此問題——百分比布局,在這種布局中,我們可以不再使用wrap_contentmatch_parent等方式來指定控制元件的大小,而是允許直接指定控制元件在布局中所占的百分比,這樣的話就可以輕松實作平分布局甚至是任意比例分割布局的效果了,

  • 添加依賴
 implementation 'com.android.support:percent:24.4.0'
  • 撰寫xml
<?xml version="1.0" encoding="utf-8"?>
<androidx.percentlayout.widget.PercentFrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    xmlns:app="http://schemas.android.com/apk/res-auto">
    <Button
        android:id="@+id/button1"
        android:text="Button1"
        android:layout_gravity="left|top"
        app:layout_widthPercent="50%"
        app:layout_heightPercent="50%">
    </Button>
    <Button
        android:id="@+id/button2"
        android:text="Button2"
        android:layout_gravity="right|top"
        app:layout_widthPercent="50%"
        app:layout_heightPercent="50%">
    </Button>
    <Button
        android:id="@+id/button3"
        android:text="Button3"
        android:layout_gravity="left|bottom"
        app:layout_widthPercent="50%"
        app:layout_heightPercent="50%">
    </Button>
    <Button
        android:id="@+id/button4"
        android:text="Button4"
        android:layout_gravity="right|bottom"
        app:layout_widthPercent="50%"
        app:layout_heightPercent="50%">
    </Button>
</androidx.percentlayout.widget.PercentFrameLayout>

3.8 常用的控制元件

  • TextView 顯示文字,ImageView 顯示圖片,EditText 輸入框,Button 按鈕,CheckBox 復選框,RadioButton 單選按鈕(和 RadioGroup 配合使用)

ListView(簡單用法)

  • ListView絕對可以稱得上是Android中最常用的控制元件之一,幾乎所有的應用程式都會用到它(相當于展示資料的表格)

  • Android中提供了很多配接器的實作類,其中我認為最好用的就是ArrayAdapter,

<?xml version="1.0" encoding="utf-8"?>
<androidx.appcompat.widget.LinearLayoutCompat
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    xmlns:android="http://schemas.android.com/apk/res/android">

    <ListView
        android:id="@+id/listview"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        />
</androidx.appcompat.widget.LinearLayoutCompat>
package com.shu;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class ThirdActivity extends AppCompatActivity {


    private String[] data={"01","02","03","04","05","06","07","08",
                           "09","10","11","12","13","14","15","16"
    };

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_third);
        ArrayAdapter<String> adapter =new ArrayAdapter<String>(ThirdActivity.this,android.R.layout.simple_list_item_1,data);
        ListView listView = (ListView) findViewById(R.id.listview);
        listView.setAdapter(adapter);
    }
}

當然我們也可以自定義頁面的呈現效果,和為每一個選項提供監聽事件,更多請參考網路

RecyclerView(更加強大)

詳細用法參考:https://www.jianshu.com/p/4f9591291365

3.9 主題切換

在這里插入圖片描述
在這里插入圖片描述

在這里插入圖片描述

3.10 Android中的單位

  • px(像素):螢屏上的點,pixels(像素)不同設備顯示效果相同
  • in(英寸):長度單位
  • mm(毫米):長度單位
  • pt(磅):1/72英寸
  • dp(與密度無關的像素):一種基于螢屏密度的抽象單位,在每英寸160點的顯示幕上,1dp = 1px
  • dip:與dp相同, device independent pixels(設備獨立像素). 不同設備有不同的顯示效果,多用于 Google示例中,
  • sp(與刻度無關的像素):與dp類似,但是可以根據用戶的字體大小首選項進行縮放.scaled pixels(放大 像素). 主要用于字體顯示best for textsize,
  • 盡量使用dp作為空間大小單位,sp作為和文字相關大小單

3.11 綜合練習

效果圖(只關注布局效果,不關注邏輯代碼)

在這里插入圖片描述

代碼如下

  • 布局
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    xmlns:android="http://schemas.android.com/apk/res/android">

    <RadioGroup
        android:id="@+id/group"
        android:layout_alignParentBottom="true"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:layout_marginBottom="10dp"
        >

        <RadioButton
            android:id="@+id/mess"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:button="@null"
            android:text="訊息"
            android:textColor="@drawable/qq"
            android:drawableTop="@drawable/mess"
            android:gravity="center"
            />

        <RadioButton
            android:id="@+id/person"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:button="@null"
            android:text="聯系人"
            android:textColor="@drawable/qq"
            android:drawableTop="@drawable/person"
            android:gravity="center"
            />

        <RadioButton
            android:id="@+id/look"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:button="@null"
            android:text="看點"
            android:textColor="@drawable/qq"
            android:drawableTop="@drawable/look"
            android:gravity="center"
            />

        <RadioButton
            android:id="@+id/star"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:button="@null"
            android:text="動態"
            android:textColor="@drawable/qq"
            android:drawableTop="@drawable/star"
            android:gravity="center"
            />

    </RadioGroup>

<!--    <View-->
<!--        android:layout_width="match_parent"-->
<!--        android:layout_height="1dp"-->
<!--        android:background="#000"-->
<!--        android:layout_above="@+id/group"-->
<!--        />-->


    <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_above="@+id/group"
        android:layout_marginBottom="3dp"
        android:background="#E6E4E4">

        <RelativeLayout

            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <RelativeLayout
                android:id="@+id/top"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="#2196F3">

                <ImageView
                    android:id="@+id/logo"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="2dp"
                    android:layout_marginTop="5dp"
                    android:layout_marginBottom="5dp"
                    android:src="@mipmap/logo" />

                <TextView
                    android:id="@+id/main"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_centerHorizontal="true"
                    android:layout_centerVertical="true"
                    android:text="首頁"
                    android:textColor="#ffffff"
                    android:textSize="24dp" />

                <ImageView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignParentRight="true"
                    android:layout_marginTop="5dp"
                    android:layout_marginRight="2dp"
                    android:layout_marginBottom="5dp"
                    android:src="@mipmap/add" />
            </RelativeLayout>


            <LinearLayout
                android:id="@+id/mains"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@+id/top"
                android:layout_marginTop="10dp">

                <EditText
                    android:id="@+id/search"
                    android:layout_width="match_parent"
                    android:layout_height="35dp"
                    android:background="@drawable/bg"
                    android:gravity="center"
                    android:text="搜索"
                    android:cursorVisible="false"
                    android:onClick="search"
                    android:maxLines="1"
                    >
                </EditText>
            </LinearLayout>


            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_below="@+id/mains"
                >

                <ListView
                    android:id="@+id/list"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"/>
            </LinearLayout>

        </RelativeLayout>

    </FrameLayout>

</RelativeLayout>
  • 顏色選擇器
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_checked="true" android:color="#FB0404"/>
    <item android:state_checked="false" android:color="#0E0E0E"/>
    <item android:color="#0B0A0A"/>
</selector>
  • 形狀編輯器
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <corners android:radius="40dp"/>
    <solid android:color="#F4F2F2"/>
    <stroke android:color="#F8F5F5" android:width="1dp"/>
</shape>

轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/290473.html

標籤:其他

上一篇:Delphi10.4.2關于Android設備除錯

下一篇:Android系統 linux內核按鍵驅動開發

標籤雲
其他(157675) Python(38076) JavaScript(25376) Java(17977) C(15215) 區塊鏈(8255) C#(7972) AI(7469) 爪哇(7425) MySQL(7132) html(6777) 基礎類(6313) sql(6102) 熊猫(6058) PHP(5869) 数组(5741) R(5409) Linux(5327) 反应(5209) 腳本語言(PerlPython)(5129) 非技術區(4971) Android(4554) 数据框(4311) css(4259) 节点.js(4032) C語言(3288) json(3245) 列表(3129) 扑(3119) C++語言(3117) 安卓(2998) 打字稿(2995) VBA(2789) Java相關(2746) 疑難問題(2699) 细绳(2522) 單片機工控(2479) iOS(2429) ASP.NET(2402) MongoDB(2323) 麻木的(2285) 正则表达式(2254) 字典(2211) 循环(2198) 迅速(2185) 擅长(2169) 镖(2155) 功能(1967) .NET技术(1958) Web開發(1951) python-3.x(1918) HtmlCss(1915) 弹簧靴(1913) C++(1909) xml(1889) PostgreSQL(1872) .NETCore(1853) 谷歌表格(1846) Unity3D(1843) for循环(1842)

熱門瀏覽
  • 【從零開始擼一個App】Dagger2

    Dagger2是一個IOC框架,一般用于Android平臺,第一次接觸的朋友,一定會被搞得暈頭轉向。它延續了Java平臺Spring框架代碼碎片化,注解滿天飛的傳統。嘗試將各處代碼片段串聯起來,理清思緒,真不是件容易的事。更不用說還有各版本細微的差別。 與Spring不同的是,Spring是通過反射 ......

    uj5u.com 2020-09-10 06:57:59 more
  • Flutter Weekly Issue 66

    新聞 Flutter 季度調研結果分享 教程 Flutter+FaaS一體化任務編排的思考與設計 詳解Dart中如何通過注解生成代碼 GitHub 用對了嗎?Flutter 團隊分享如何管理大型開源專案 插件 flutter-bubble-tab-indicator A Flutter librar ......

    uj5u.com 2020-09-10 06:58:52 more
  • Proguard 常用規則

    介紹 Proguard 入口,如何查看輸出,如何使用 keep 設定入口以及使用實體,如何配置壓縮,混淆,校驗等規則。

    ......

    uj5u.com 2020-09-10 06:59:00 more
  • Android 開發技術周報 Issue#292

    新聞 Android即將獲得類AirDrop功能:可向附近設備快速分享檔案 谷歌為安卓檔案管理應用引入可安全隱藏資料的Safe Folder功能 Android TV新主界面將顯示電影、電視節目和應用推薦內容 泄露的Android檔案暗示了傳說中的谷歌Pixel 5a與折疊屏新機 谷歌發布Andro ......

    uj5u.com 2020-09-10 07:00:37 more
  • AutoFitTextureView Error inflating class

    報錯: Binary XML file line #0: Binary XML file line #0: Error inflating class xxx.AutoFitTextureView 解決: <com.example.testy2.AutoFitTextureView android: ......

    uj5u.com 2020-09-10 07:00:41 more
  • 根據Uri,Cursor沒有獲取到對應的屬性

    Android: 背景:呼叫攝像頭,拍攝視頻,指定保存的地址,但是回傳的Cursor檔案,只有名稱和大小的屬性,沒有其他諸如時長,連ID屬性都沒有 使用 cursor.getInt(cursor.getColumnIndexOrThrow(MediaStore.Video.Media.DURATIO ......

    uj5u.com 2020-09-10 07:00:44 more
  • Android連載29-持久化技術

    一、持久化技術 我們平時所使用的APP產生的資料,在記憶體中都是瞬時的,會隨著斷電、關機等丟失資料,因此android系統采用了持久化技術,用于存盤這些“瞬時”資料 持久化技術包括:檔案存盤、SharedPreference存盤以及資料庫存盤,還有更復雜的SD卡記憶體儲。 二、檔案存盤 最基本存盤方式, ......

    uj5u.com 2020-09-10 07:00:47 more
  • Android Camera2Video整合到自己專案里

    背景: Android專案里呼叫攝像頭拍攝視頻,原本使用的 MediaStore.ACTION_VIDEO_CAPTURE, 后來因專案需要,改成了camera2 1.Camera2Video 官方demo有點問題,下載后,不能直接整合到專案 問題1.多次拍攝視頻崩潰 問題2.雙擊record按鈕, ......

    uj5u.com 2020-09-10 07:00:50 more
  • Android 開發技術周報 Issue#293

    新聞 谷歌為Android TV開發者提供多種新功能 Android 11將自動填表功能整合到鍵盤輸入建議中 谷歌宣布Android Auto即將支持更多的導航和數字停車應用 谷歌Pixel 5只有XL版本 搭載驍龍765G且將比Pixel 4更便宜 [圖]Wear OS將迎來重磅更新:應用啟動時間 ......

    uj5u.com 2020-09-10 07:01:38 more
  • 海豚星空掃碼投屏 Android 接收端 SDK 集成 六步驟

    掃碼投屏,開放網路,獨占設備,不需要額外下載軟體,微信掃碼,發現設備。支持標準DLNA協議,支持倍速播放。視頻,音頻,圖片投屏。好點意思。還支持自定義基于 DLNA 擴展的操作動作。好像要收費,沒體驗。 這里簡單記錄一下集成程序。 一 跟目錄的build.gradle添加私有mevan倉庫 mave ......

    uj5u.com 2020-09-10 07:01:43 more
最新发布
  • 歡迎頁輪播影片

    如圖,引導開始,球從上落下,同時淡入文字,然后文字開始輪播,最后一頁時停止,點擊進入首頁。 在來看看效果圖。 重力球先不講,主要歡迎輪播簡單實作 首先新建一個類 TextTranslationXGuideView,用于影片展示 文本是類似的,最后會有個圖片箭頭影片,布局很簡單,就是一個 TextVi ......

    uj5u.com 2023-04-20 08:40:31 more
  • 【FAQ】關于華為推送服務因營銷訊息頻次管控導致服務通訊類訊息

    一. 問題描述 使用華為推送服務下發IM訊息時,下發訊息請求成功且code碼為80000000,但是手機總是收不到訊息; 在華為推送自助分析(Beta)平臺查看發現,訊息發送觸發了頻控。 二. 問題原因及背景 2023年1月05日起,華為推送服務對咨詢營銷類訊息做了單個設備每日推送數量上限管理,具體 ......

    uj5u.com 2023-04-20 08:40:11 more
  • 歡迎頁輪播影片

    如圖,引導開始,球從上落下,同時淡入文字,然后文字開始輪播,最后一頁時停止,點擊進入首頁。 在來看看效果圖。 重力球先不講,主要歡迎輪播簡單實作 首先新建一個類 TextTranslationXGuideView,用于影片展示 文本是類似的,最后會有個圖片箭頭影片,布局很簡單,就是一個 TextVi ......

    uj5u.com 2023-04-20 08:39:36 more
  • 【FAQ】關于華為推送服務因營銷訊息頻次管控導致服務通訊類訊息

    一. 問題描述 使用華為推送服務下發IM訊息時,下發訊息請求成功且code碼為80000000,但是手機總是收不到訊息; 在華為推送自助分析(Beta)平臺查看發現,訊息發送觸發了頻控。 二. 問題原因及背景 2023年1月05日起,華為推送服務對咨詢營銷類訊息做了單個設備每日推送數量上限管理,具體 ......

    uj5u.com 2023-04-20 08:39:13 more
  • iOS從UI記憶體地址到讀取成員變數(oc/swift)

    開發除錯時,我們發現bug時常首先是從UI顯示發現例外,下一步才會去定位UI相關連的資料的。XCode有給我們提供一系列debug工具,但是很多人可能還沒有形成一套穩定的除錯流程,因此本文嘗試解決這個問題,順便提出一個暴論:UI顯示例外問題只需要兩個步驟就能完成定位作業的80%: 定位例外 UI 組 ......

    uj5u.com 2023-04-19 09:16:23 more
  • FIDE重磅更新!性能飛躍!體驗有禮!

    FIDE 開發者工具重構升級啦!實作500%性能提升,誠邀體驗! 一直以來不少開發者朋友在社區反饋,在使用 FIDE 工具的程序中,時常會遇到諸如加載不及時、代碼預覽/渲染性能不如意的情況,十分影響開發體驗。 作為技術團隊,我們深知一件趁手的開發工具對開發者的重要性,因此,在2023年開年,FinC ......

    uj5u.com 2023-04-19 09:16:15 more
  • 游戲內嵌社區服務開放,助力開發者提升玩家互動與留存

    華為 HMS Core 游戲內嵌社區服務提供快速訪問華為游戲中心論壇能力,支持玩家直接在游戲內瀏覽帖子和交流互動,助力開發者擴展內容生產和觸達的場景。 一、為什么要游戲內嵌社區? 二、游戲內嵌社區的典型使用場景 1、游戲內打開論壇 您可以在游戲內繪制論壇入口,為玩家提供沉浸式發帖、瀏覽、點贊、回帖、 ......

    uj5u.com 2023-04-19 09:15:46 more
  • iOS從UI記憶體地址到讀取成員變數(oc/swift)

    開發除錯時,我們發現bug時常首先是從UI顯示發現例外,下一步才會去定位UI相關連的資料的。XCode有給我們提供一系列debug工具,但是很多人可能還沒有形成一套穩定的除錯流程,因此本文嘗試解決這個問題,順便提出一個暴論:UI顯示例外問題只需要兩個步驟就能完成定位作業的80%: 定位例外 UI 組 ......

    uj5u.com 2023-04-19 09:14:53 more
  • FIDE重磅更新!性能飛躍!體驗有禮!

    FIDE 開發者工具重構升級啦!實作500%性能提升,誠邀體驗! 一直以來不少開發者朋友在社區反饋,在使用 FIDE 工具的程序中,時常會遇到諸如加載不及時、代碼預覽/渲染性能不如意的情況,十分影響開發體驗。 作為技術團隊,我們深知一件趁手的開發工具對開發者的重要性,因此,在2023年開年,FinC ......

    uj5u.com 2023-04-19 09:14:08 more
  • 游戲內嵌社區服務開放,助力開發者提升玩家互動與留存

    華為 HMS Core 游戲內嵌社區服務提供快速訪問華為游戲中心論壇能力,支持玩家直接在游戲內瀏覽帖子和交流互動,助力開發者擴展內容生產和觸達的場景。 一、為什么要游戲內嵌社區? 二、游戲內嵌社區的典型使用場景 1、游戲內打開論壇 您可以在游戲內繪制論壇入口,為玩家提供沉浸式發帖、瀏覽、點贊、回帖、 ......

    uj5u.com 2023-04-19 09:08:34 more