主頁 > 移動端開發 > Android實戰簡單新聞主界面設計

Android實戰簡單新聞主界面設計

2021-10-02 07:13:08 移動端開發

前言

這是自己學習程序單獨做出來的,挺適合新手學習,熟悉最基本的banner,imageview,listview,text等等基礎控制元件,適合初學者,原專案共有五個模塊,這個是其中一個模塊

提示:以下是本篇文章正文內容,下面案例可供參考

效果圖:

在這里插入圖片描述
總體思路概述:
如上方效果圖所示,我們頂部是使用了一個banner的控制元件來實作圖片的輪播效果,這里我使用的是第三方插件,所以實作的輪播代碼相對于簡短,下方我提供的專案原始碼里面就有,下方的的服務入口使用了我們最基礎的LinearLayout的布局,在布局里面放了ImageView和TextView控制元件,這都是我們最基礎的控制元件,也很適合初學者學習,同理,下方的新聞導航欄,也是直接使用TextView控制元件實作,在下方新聞串列也是最常見的ListView控制元件,最下方的底部導航欄使用了RadioButton控制元件和Fragment來實作點擊圖示變色和切換到不同頁面的操作,有需要完整源代碼可運行的,可以看下方專案鏈接,可直接匯入運行,

1.主頁面布局檔案

fragment_host1.xml的代碼如下(示例):

<?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:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context=".hostFragment.HostFragment1">

    <!-- TODO: Update blank fragment layout -->
    <com.youth.banner.Banner
        android:id="@+id/banner1"
        android:layout_width="match_parent"
        android:layout_height="200dp" />
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="30dp">


        <TextView
            android:id="@+id/textView"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:text="推薦服務"
            android:gravity="center_vertical"/>
    </LinearLayout>
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical">
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="80dp"
            android:orientation="horizontal">
            <LinearLayout
                android:layout_width="0dp"
                android:layout_weight="1"
                android:layout_height="wrap_content"
                android:orientation="vertical"
                >

                <ImageView
                    android:id="@+id/image1"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:src="@mipmap/ditie" />
                <TextView
                    android:id="@+id/ditie"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="6dp"
                    android:layout_weight="1"
                    android:text="城市地鐵" />
            </LinearLayout>
            <LinearLayout
                android:layout_width="0dp"
                android:layout_weight="1"
                android:layout_height="wrap_content"
                android:orientation="vertical"
                >
                <ImageView
                    android:id="@+id/image2"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:src="@mipmap/bus"/>
                <TextView
                    android:id="@+id/bus"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="6dp"
                    android:layout_weight="1"
                    android:text="智慧巴士" />
            </LinearLayout>
            <LinearLayout
                android:layout_width="0dp"
                android:layout_weight="1"
                android:layout_height="wrap_content"
                android:orientation="vertical"
                >
                <ImageView
                    android:id="@+id/image3"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:src="@mipmap/menzheng"/>
                <TextView
                    android:id="@+id/menzheng"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="6dp"
                    android:layout_weight="1"
                    android:text="門診預約" />
            </LinearLayout>
            <LinearLayout
                android:layout_width="0dp"
                android:layout_weight="1"
                android:layout_height="wrap_content"
                android:orientation="vertical"
                >
                <ImageView
                    android:id="@+id/image4"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:src="@mipmap/live"/>
                <TextView
                    android:id="@+id/live"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="6dp"
                    android:layout_weight="1"
                    android:text="生活繳費" />
            </LinearLayout>
            <LinearLayout
                android:layout_width="0dp"
                android:layout_weight="1"
                android:layout_height="wrap_content"
                android:orientation="vertical"
                >
                <ImageView
                    android:id="@+id/image5"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:src="@mipmap/weizhang"/>
                <TextView
                    android:id="@+id/weizhang"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="6dp"
                    android:layout_weight="1"
                    android:text="違章查詢" />
            </LinearLayout>

        </LinearLayout>
        <LinearLayout
            android:layout_width="160dp"
            android:layout_height="80dp"
            android:orientation="horizontal">
            <LinearLayout
                android:layout_width="0dp"
                android:layout_weight="1"
                android:layout_height="wrap_content"
                android:orientation="vertical">
                <ImageView
                    android:id="@+id/image6"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:src="@mipmap/pack"/>
                <TextView
                    android:id="@+id/pack"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="6dp"
                    android:text="停車場" />
            </LinearLayout>
            <LinearLayout
                android:layout_width="0dp"
                android:layout_weight="1"
                android:layout_height="wrap_content"
                android:orientation="vertical">
                <ImageView
                    android:id="@+id/image7"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:src="@mipmap/gdfuwu"/>
                <TextView
                    android:id="@+id/gdfuwu"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="6dp"
                    android:text="更多服務"
                    />
            </LinearLayout>

        </LinearLayout>
    </LinearLayout>
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        android:orientation="vertical">
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal">
            <TextView
                android:text="時政"
                android:id="@+id/szTextView"
                android:gravity="center"
                android:layout_width="0dp"
                android:layout_weight="1"
                android:layout_height="wrap_content"></TextView>
            <TextView
                android:text="基層"
                android:id="@+id/jcTextView"
                android:layout_width="0dp"
                android:layout_weight="1"
                android:layout_height="wrap_content"></TextView>
            <TextView
                android:text="廣播"
                android:id="@+id/gbTextView"
                android:layout_width="0dp"
                android:layout_weight="1"
                android:layout_height="wrap_content"></TextView>
            <TextView
                android:text="電視"
                android:id="@+id/dsTextView"
                android:layout_width="0dp"
                android:layout_weight="1"
                android:layout_height="wrap_content"></TextView>
            <TextView
                android:text="旅游"
                android:id="@+id/lyTextView"
                android:layout_width="0dp"
                android:layout_weight="1"
                android:layout_height="wrap_content"></TextView>
            <TextView
                android:text="視頻"
                android:id="@+id/spTextView"
                android:layout_width="0dp"
                android:layout_weight="1"
                android:layout_height="wrap_content"></TextView>
        </LinearLayout>

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

    </LinearLayout>
</LinearLayout>

2.底部導航欄布局檔案

activity_host.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"
    tools:context=".HostActivity"
    android:orientation="vertical">

    <FrameLayout
        android:id="@+id/content"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1"/>

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical">

    <RadioGroup
        android:id="@+id/navgroup"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_weight="0.0"
        android:gravity="center_vertical"
        android:orientation="horizontal"
        android:background="#E8E4E4"
        android:paddingTop="5dp">
        <RadioButton
            android:id="@+id/radioBtn1"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:gravity="center_horizontal"
            android:drawableTop="@drawable/selector_tab_1"
            android:button="@null"
            android:text="首頁"/>

        <RadioButton
            android:id="@+id/radioBtn2"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:gravity="center_horizontal"
            android:drawableTop="@drawable/selector_tab_2"
            android:button="@null"
            android:text="新聞"/>
        <RadioButton
            android:id="@+id/radioBtn3"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:gravity="center_horizontal"
            android:drawableTop="@drawable/selector_tab_3"
            android:button="@null"
            android:text="全部服務"/>
        <RadioButton
            android:id="@+id/radioBtn4"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:drawableTop="@drawable/selector_tab_1"
            android:gravity="center_horizontal"
            android:button="@null"
            android:text="智慧環保"/>
        <RadioButton
            android:id="@+id/radioBtn5"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:drawableTop="@drawable/selector_tab_1"
            android:gravity="center_horizontal"
            android:button="@null"
            android:text="個人中心"/>


    </RadioGroup>
</LinearLayout>



</LinearLayout>

3.主頁面java代碼

HostActivity的代碼如下(示例):

package com.example.smartcity;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
import android.annotation.SuppressLint;
import android.os.Bundle;
import android.widget.RadioGroup;
import com.example.smartcity.hostFragment.HostFragment1;
import com.example.smartcity.hostFragment.HostFragment2;
public class HostActivity extends AppCompatActivity  {
    private RadioGroup radioGroup;
    @SuppressLint("WrongViewCast")
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_host);
        radioGroup = findViewById(R.id.navgroup);

        radioGroup.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup radioGroup, int i) {
                if (i == R.id.radioBtn1) {
                    switchFragment(R.id.content, "首頁");
                }
                if (i == R.id.radioBtn2) {
                    switchFragment(R.id.content, "第2頁");
                }

            }
        });

        switchFragment(R.id.content, "首頁");
    }

    private void switchFragment(int id, String tag) {

        FragmentManager manager = getSupportFragmentManager();
        Fragment fragment = manager.findFragmentByTag(tag);
        if (fragment == null) {
            if (tag == "首頁") {
                fragment = new HostFragment1();
            }
            if (tag == "第2頁") {
                fragment = new HostFragment2();
            }
        }
        FragmentTransaction ft = manager.beginTransaction();
        ft.replace(id, fragment, tag);
        ft.commit();
    }


}

這邊實作的是主頁面底部導航切換的一個效果,通過點擊導航欄圖示跳轉到新的fragment的頁面,


3.主頁面fragment1代碼

HostFragment1的代碼如下(示例):

package com.example.smartcity.hostFragment;
import android.content.Intent;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
import com.example.smartcity.DetailActivity;
import com.example.smartcity.R;
import com.example.smartcity.adapter.ImageAdapter;
import com.example.smartcity.adapter.NewsAdapter;
import com.example.smartcity.bean.ImageBean;
import com.example.smartcity.bean.NewsBean;
import com.example.smartcity.DitieActivity;
import com.example.smartcity.utils.JsonParse;
import com.youth.banner.Banner;
import com.youth.banner.indicator.CircleIndicator;
import java.util.ArrayList;
import java.util.List;
public class HostFragment1 extends Fragment {
// 輪播
    private List<ImageBean> imageBeanList;
    private ImageAdapter imageAdapter;
    private View layoutView;
    private Banner banner;
    //新聞
    private ImageView imageView1;
    private ListView listViewNews;
    private List<NewsBean> newsList;
    private NewsAdapter newsAdapter;
    private TextView tvSZ, tvJC;

    private void initView() {
        banner = layoutView.findViewById(R.id.banner1);
        imageView1 = layoutView.findViewById(R.id.image1);
        listViewNews = layoutView.findViewById(R.id.listViewNews);
        tvSZ = layoutView.findViewById(R.id.szTextView);
        tvJC = layoutView.findViewById(R.id.jcTextView);

        //顯示輪播圖
        showBanner();

        //讀取顯示新聞串列
        showNews();

        imageView1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(HostFragment1.this.getActivity(), DitieActivity.class);
                startActivity(intent);
            }
        });

        tvSZ.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                showListByType("時政");

            }
        });

        tvJC.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                showListByType("基層");
            }
        });

        listViewNews.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
                Intent intent = new Intent(HostFragment1.this.getActivity(), DetailActivity.class);
                intent.putExtra("title", newsList.get(i).getTitle());
                intent.putExtra("content", newsList.get(i).getContent());
                intent.putExtra("imgUrl", newsList.get(i).getImgUrl());
                startActivity(intent);
            }
        });

    }

    private void showListByType(String typeStr) {
        List<NewsBean> list = new ArrayList<NewsBean>();
        for (NewsBean newsBean : newsList) {
            if (newsBean.getPressCategory().equals(typeStr)) {
                list.add(newsBean);
            }
        }
        newsAdapter = new NewsAdapter(layoutView.getContext(), list);
        listViewNews.setAdapter(newsAdapter);
    }

    private void showNews() {
        newsList = new ArrayList<NewsBean>();
        newsList = JsonParse.getInfos(layoutView.getContext());
        newsAdapter = new NewsAdapter(layoutView.getContext(), newsList);
        listViewNews.setAdapter(newsAdapter);
    }

    private void showBanner() {
        imageBeanList = new ArrayList<ImageBean>();
        ImageBean imageBean = new ImageBean(R.mipmap.home2);
        imageBeanList.add(imageBean);
        imageBean = new ImageBean(R.mipmap.home3);
        imageBeanList.add(imageBean);
        imageBean = new ImageBean(R.mipmap.home4);
        imageBeanList.add(imageBean);
        imageBean = new ImageBean(R.mipmap.home1);
        imageBeanList.add(imageBean);
        imageAdapter = new ImageAdapter(imageBeanList);
        banner.setAdapter(imageAdapter);
        banner.setIndicator(new CircleIndicator(HostFragment1.this.getActivity()));
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        layoutView = inflater.inflate(R.layout.fragment_host1,null);
        initView();
        return layoutView;
    }

}
  

這些都是一些基礎控制元件的使用,我這邊就不一一說明了,我就拿其中的listview說明吧,其他的操作也都是差不多,都是通過參考控制元件,首先這邊listview想要讀取到新聞串列的資訊,那我們這邊肯定要做讀取這些新聞資訊的一個操作,當讀取到新聞資訊我們下一步做的才是給他顯示到頁面上,我們這邊是通過showNews來進行對配接器對于json的決議,以此來獲取到json的資訊,在把獲取到的資訊傳輸到我們頁面上


專案下載

原始碼下載地址:新聞主頁面帶新聞串列帶輪播底部導航欄完整原始碼專案

總結

以上部分資訊是我在之前學習程序中通過一些我們最常用也是最基礎的控制元件來實作了新聞主頁的設計,最基礎的控制元件非常適合初學者來學習,能讓他們清楚的決議代碼并掌味訓礎控制元件:listview、textview、imageview、fragment、等等控制元件,只有掌握并熟練了基礎控制元件,那才能提高我們的編碼能麗,以上是在初學階段自己摸索寫出來的頁面,也存在著許多不足和需要優化修改的地方,也可以給我提供建議,希望自己的這份專案可以給剛開始學習android的朋友帶來幫助,

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

標籤:其他

上一篇:Android——實作堆疊折線圖(動態添加資料)

下一篇:我為大家帶來了15張超酷的登錄界面!!!

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