主頁 > 移動端開發 > Android常用布局

Android常用布局

2021-10-27 10:03:42 移動端開發

1.線性布局(LinearLayout)

常用屬性

1.orientation:布局中組件的排列方式(默認為水平方向(horizontal),垂直方向(vertical))
新建一個布局檔案:linearLayout.xml

<?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:orientation="vertical"
    tools:context=".MainActivity">

<!--    水平(默認)方向的效果-->
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="300dp"
        android:orientation="horizontal">
        <Button
            android:text="水平第一個"
            android:layout_width="100dp"
            android:layout_height="100dp"/>
        <Button
            android:text="水平第二個"
            android:layout_width="100dp"
            android:layout_height="100dp"/>
        <Button
            android:text="水平第三個"
            android:layout_width="100dp"
            android:layout_height="100dp"/>
    </LinearLayout>
<!--    垂直方向的效果-->
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">
        <Button
            android:text="垂直第一個"
            android:layout_width="100dp"
            android:layout_height="100dp"/>
        <Button
            android:text="垂直第二個"
            android:layout_width="100dp"
            android:layout_height="100dp"/>
        <Button
            android:text="垂直第三個"
            android:layout_width="100dp"
            android:layout_height="100dp"/>
    </LinearLayout>

</LinearLayout>

效果圖:
排列方式

從上圖可以看出第一個線性布局采用的是默認的水平方向的排列方式,第二個采用垂直方向的排列方式,

2.gravity:控制組件所包含的子元素的對齊方式,可以多個組合
默認情況:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:background="@color/white"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <LinearLayout
        android:background="@color/black"
        android:layout_width="100dp"
        android:layout_height="100dp"/>
    <LinearLayout
        android:background="@color/purple_500"
        android:layout_width="100dp"
        android:layout_height="100dp"/>
    <LinearLayout
        android:background="@color/teal_200"
        android:layout_width="100dp"
        android:layout_height="100dp"/>

</LinearLayout>


設定gravity屬性后:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:background="@color/white"
    android:orientation="vertical"
    android:gravity="center_vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <LinearLayout
        android:background="@color/black"
        android:layout_width="100dp"
        android:layout_height="100dp"/>
    <LinearLayout
        android:background="@color/purple_500"
        android:layout_width="100dp"
        android:layout_height="100dp"/>
    <LinearLayout
        android:background="@color/teal_200"
        android:layout_width="100dp"
        android:layout_height="100dp"/>

</LinearLayout>

gravity屬性設定為center_vertical,組件垂直居中顯示,也可以通過 “|”來進行屬性的組合
例如:android:gravity=“center_vertical|center_horizontal”:這時就會居中顯示

3.layout:gravity:控制組件在父容器中的對齊方式(和gravity不同的是gravity是父容器設定組件在其中的對齊方式,layout:gravity是組件設定自身在父容器中的對齊方式)
4.background:設定一個背景圖片或者直接用顏色覆寫
5.divider:設定分割線
6.showDividers:設定分割線所在的位置,none(無),beginning(開始位置),end(結束位置),middle(每兩個組件之間)
7.dividerPadding:設定分割線的padding(分割線距離父容器的邊距)
分割線可以使用drawable資源,直接在父容器的屬性中進行設定,

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:background="@color/white"
    android:orientation="vertical"
    android:gravity="center_vertical|center_horizontal"
    android:divider="@drawable/ic_baseline_arrow_right_alt_24"
    android:showDividers="middle"
    android:dividerPadding="150dp"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

分割線

8.layout_weight:權重(進行等比例劃磁區域)

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:background="@color/white"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
   <LinearLayout
       android:background="@color/black"
       android:layout_width="match_parent"
       android:layout_height="0dp"
       android:layout_weight="1"/>
    <LinearLayout
        android:background="@color/purple_200"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="2"/>
    <LinearLayout
        android:background="@color/teal_700"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="3"/>
</LinearLayout>

權重
從上圖可以看出三個線性布局按照1:2:3的比例均勻的分配了父容器的空間,

,如果不使用0dp的方式,使用match_parent的方式

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:background="@color/white"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
   <LinearLayout
       android:background="@color/black"
       android:layout_width="match_parent"
       android:layout_height="match_parent"
       android:layout_weight="2"/>
    <LinearLayout
        android:background="@color/purple_200"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_weight="1"/>
    <LinearLayout
        android:background="@color/teal_700"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_weight="1"/>
</LinearLayout>

權重2
可以發現,權重為2的黑色區域沒有分配到空間,
這時就需要計算一下了:

  1. 三個區域全部是match_parent,但是螢屏只有一個,所以每個區域分配到的螢屏是:
    1-3= -2個螢屏
  2. 然后按照每塊區域的權重比例進行分配(2:1:1)
  3. 第一個線性布局分配到的區域是:1-2*(2/4)=0,所以沒有顯示黑色的區域,剩下兩個線性布局也一次計算,分別分配到的區域是1/2,1/2.所以就造成了如上圖顯示的情況,

2.相對布局(RelativeLayout)

根據父容器定位

  1. layout_alignParentLeft:左對齊
  2. layout_alignParentRight:右對齊
  3. layout_alignParentTop:頂部對齊
  4. layout_alignParentBottom:底部對齊
  5. layout_alignHorizontal:水平居中
  6. layout_alignVertical:垂直居中
  7. layout_centerInParent:中間位置
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:background="@color/white"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <RelativeLayout
        android:layout_alignParentLeft="true"
        android:background="#ff0000"
        android:layout_width="200dp"
        android:layout_height="200dp"/>
    <RelativeLayout
        android:layout_alignParentRight="true"
        android:background="#00ff00"
        android:layout_width="200dp"
        android:layout_height="200dp"/>
    <RelativeLayout
        android:layout_centerInParent="true"
        android:background="#0000ff"
        android:layout_width="200dp"
        android:layout_height="200dp"/>
</RelativeLayout>

示例圖:
根據父容器定位

根據兄弟組件定位

  1. layout_toLeftOf:放置于參考組件的左邊
  2. layout_toRightOf:放置于參考組件的右邊
  3. layout_above:放置于參考組件的上方
  4. layout_below:放置于參開組件的下方
  5. layout_alignTop:對其與參考組件的上邊界
  6. layout_alignBottom:對其參考組件的下邊界
  7. layout_alignLeft:對齊參考組件的左邊界
  8. layout_alignRight:對齊參考組件的右邊界
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
   android:background="@color/white"
   xmlns:app="http://schemas.android.com/apk/res-auto"
   android:orientation="vertical"
   android:layout_width="match_parent"
   android:layout_height="match_parent">
   <RelativeLayout
       android:id="@+id/one"
       android:background="#ff0000"
       android:layout_width="200dp"
       android:layout_height="200dp"/>
   <RelativeLayout
       android:id="@+id/two"
       android:layout_below="@id/one"
       android:background="#00ff00"
       android:layout_width="200dp"
       android:layout_height="200dp"/>
   <RelativeLayout
       android:layout_below="@id/one"
       android:layout_toRightOf="@id/two"
       android:id="@+id/three"
       android:background="#0000ff"
       android:layout_width="200dp"
       android:layout_height="200dp"/>
</RelativeLayout>

示例圖:
根據兄弟組件定位

3.FrameLayout(幀布局)

FrameLayout是六大布局中最簡單的一個,在該布局中放置的所有空間都默認放到螢屏的左上方,幀布局的大小由控制元件中最大的子控制元件決定,如果控制元件一樣大的話,同一時刻我們只能看到最上方的控制元件,雖然FrameLayout會默認將子控制元件放置于左上方,但是我們也可以通過layout_gravity指定控制元件的位置,

在FrameLayout中有一個前景影像,這個前景影像永遠在幀布局的最上方,是用戶可以直接看到的,這個前景影像是不會被子控制元件覆寫的,

用一個最簡單的例子來介紹:

<?xml version="1.0" encoding="utf-8"?>
<!--android:foreground="@drawable/ic_baseline_format_bold_24:設定前景圖片(可以是drawable資源)
android:foregroundGravity:設定前景影像顯示的位置,這里沒有進行設定-->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:background="@color/white"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:foreground="@drawable/ic_baseline_format_bold_24">

    <FrameLayout
        android:background="#0000ff"
        android:layout_width="200dp"
        android:layout_height="200dp"/>
    <FrameLayout
        android:background="#ff0000"
        android:layout_width="150dp"
        android:layout_height="150dp"/>
    <FrameLayout
        android:background="#00ff00"
        android:layout_width="100dp"
        android:layout_height="100dp"/>

</FrameLayout>

示例圖:
FrameLayout
從上圖可以看出,字母B也就是前景影像并沒有受到子控制元件的影響,而其他三個子控制元件同通過顏色的區分也能明顯看出,每添加一個子控制元件就會默認放置于父容器的左上方,并且覆寫之前已經添加的子控制元件,

4.GridLayout(網格布局)

網格布局是Android4.0之后引入的一個布局,在網格布局中我們可以直接自己設定布局的排列方式,可以自定義網格布局有多少列多少行,同時也可以直接設定組件在第幾行第幾列,也可以設定組件可以橫跨幾列或者幾行,

基礎屬性

  1. android:orientation:設定排列方式(水平或者垂直)
  2. android:layout_gravity:設定對齊方式(left,right,bottom,top,也可以使用“|”進行組合排列)
  3. android:rowCount:設定行數(一行可以顯示多少列)
  4. android:columCount:設定列數
  5. android:layout_row:設定組件所在的行
  6. android:layout_colum:設定組件所在的列
  7. android:layout_rowSpan:設定組件跨幾行
  8. android:layout_rowSpan:設定組件跨幾列

網格布局最簡單的例子就是計算器,接下來用網格布局實作一個計算器的界面:

簡易計算器

貼下xml代碼:

<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> 

當設定一個組件橫跨幾列的時候可能會發現并不會達到預期的效果,這個時候就需要使用:
android:layout_gravity=“fill”,讓該組件填充滿所占的空間,
在上面可以發現,默認每個組件都是占一行一列,可以通過weight(權重)來進行等比例劃分,會讓界面看的更加美觀,

5.TableLayout(表格布局)

如果我們在TableLayout中直接添加一個控制元件的話,這個控制元件就會占滿一行,如果想讓一行有多個控制元件的話就需要和TableRow一起使用,這里TableRow組件個數決定了該行的列數,

常用屬性

  1. android:collapseColumns:設定需要被隱藏的列的序號,從0開始
  2. android:shrinkColumns:設定可以被收縮的列的序號,從0開始(需要前置條件:子控制元件占滿當前行)
  3. android:stretchColumns:設定運行被拉伸的列的列序號,從0開始(需要當前行有剩余空間)
子控制元件的設定屬性
  1. android:layout_column:顯示在第幾列
  2. android:layout_span:組件可以橫跨幾列
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <TableRow>
        <Button
            android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:text="1"/>
        <Button
            android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:text="2"/>
        <Button
            android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:text="3"/>
        <Button
            android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:text="4"/>
        <Button
            android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:text="5"/>
    </TableRow>
    <TableRow>
        <Button
            android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:text="6"/>
        <Button
            android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:text="7"/>
        <Button
            android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:text="8"/>
        <Button
            android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:text="9"/>
        <Button
            android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:text="10"/>
    </TableRow>

</TableLayout>

collapseColumns:隱藏列
<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:collapseColumns="2">
    <TableRow>
        <Button
            android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:text="1"/>
        <Button
            android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:text="2"/>
        <Button
            android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:text="3"/>
        <Button
            android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:text="4"/>
        <Button
            android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:text="5"/>
    </TableRow>
    <TableRow>
        <Button
            android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:text="6"/>
        <Button
            android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:text="7"/>
        <Button
            android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:text="8"/>
        <Button
            android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:text="9"/>
        <Button
            android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:text="10"/>
    </TableRow>

</TableLayout>


可以發現第三列被隱藏了,拉伸和收縮列也是如此進行設定,
當然還有一個AbsoluteLayout(絕對布局),但是這個布局局限性太大,所以一般是不會使用的,

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

標籤:其他

上一篇:今天周一呀

下一篇:移動端測驗(adb命令)

標籤雲
其他(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