国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

iOS開發(fā)-聊天emoji表情與自定義動(dòng)圖表情左右滑動(dòng)控件

這篇具有很好參考價(jià)值的文章主要介紹了iOS開發(fā)-聊天emoji表情與自定義動(dòng)圖表情左右滑動(dòng)控件。希望對(duì)大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請(qǐng)大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問。

iOS開發(fā)-聊天emoji表情與自定義動(dòng)圖表情左右滑動(dòng)控件

之前開發(fā)中遇到需要實(shí)現(xiàn)聊天emoji表情與自定義動(dòng)圖表情左右滑動(dòng)控件。使用UICollectionView實(shí)現(xiàn)。

一、效果圖

iOS開發(fā)-聊天emoji表情與自定義動(dòng)圖表情左右滑動(dòng)控件,移動(dòng)開發(fā),iphone開發(fā),Objective-c,ios,cocoa,xcode,聊天表情,貼圖表情

二、實(shí)現(xiàn)代碼

UICollectionView是一種類似于UITableView但又比UITableView功能更強(qiáng)大、更靈活的視圖,這是源于它將UICollectionView對(duì)cell的布局交給了UICollectionViewLayout,而且允許用戶自定義layout來進(jìn)行布局。

2.1 UICollectionView初始化

INEmotionView.h

@interface INEmotionView : UIView

@property (nonatomic, weak) id delegate;

@property (nonatomic, strong) INEmotionFlowLayout *flowLayout;

@property (nonatomic, strong) UICollectionView *collectionView;

@property (nonatomic, strong) UIPageControl *pageControl;

- (id)initWithFrame:(CGRect)frame;

@end

INEmotionView.m

#import "INEmotionView.h"
#import "UIColor+Addition.h"

static CGFloat kCollectionHeight = 260;

@implementation INEmotionView

- (id)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor colorWithHexString:@"efeff4"];
        
        self.flowLayout =[[INEmotionFlowLayout alloc] init];
        self.flowLayout.scrollDirection = UICollectionViewScrollDirectionHorizontal;
        
        self.collectionView = [[UICollectionView alloc]initWithFrame:frame collectionViewLayout:self.flowLayout];
        self.collectionView.backgroundColor = [UIColor clearColor];
        self.collectionView.scrollEnabled = YES;
        self.collectionView.pagingEnabled = YES;
        self.collectionView.showsVerticalScrollIndicator = NO;
        self.collectionView.showsHorizontalScrollIndicator = NO;
        self.collectionView.userInteractionEnabled = YES;
        self.collectionView.exclusiveTouch = YES;
        [self addSubview:self.collectionView];
        
        self.pageControl = [[UIPageControl alloc]initWithFrame:CGRectZero];
        self.pageControl.backgroundColor = [UIColor clearColor];
        self.pageControl.currentPage = 0;
        self.pageControl.numberOfPages = 0;
        self.pageControl.currentPageIndicatorTintColor = [UIColor redColor];
        self.pageControl.pageIndicatorTintColor = [UIColor greenColor];
        [self addSubview:self.pageControl];
    }
    return self;
}

- (id)init {
    return [self initWithFrame:CGRectZero];
}

- (void)layoutSubviews {
    [super layoutSubviews];
    self.collectionView.frame = CGRectMake(0.0, (CGRectGetHeight(self.bounds) - kCollectionHeight)/2, CGRectGetWidth(self.bounds), kCollectionHeight);
    self.pageControl.frame = CGRectMake(0.0, CGRectGetMaxY(self.collectionView.frame), CGRectGetWidth(self.bounds), 50);
}

- (void)setDelegate:(id)delegate {
    _delegate = delegate;
    self.collectionView.delegate = delegate;
    self.collectionView.dataSource = delegate;
}

@end

2.2 UICollectionView實(shí)現(xiàn)控件

emoji表情與自定義動(dòng)圖表情左右切換,需要根據(jù)拆分多個(gè)section,UICollectionView的datasource
我這里使用的是5個(gè)分組,每個(gè)分組的數(shù)量如下。

- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView {
    return 5;
}

- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
    
    NSInteger sectionNumber = 60;
    switch (section) {
        case 0:
            sectionNumber = 72;
            break;
        case 1:
            sectionNumber = 8;
            break;
        case 2:
            sectionNumber = 16;
            break;
        case 3:
            sectionNumber = 24;
            break;
        case 4:
            sectionNumber = 32;
            break;
            
        default:
            break;
    }
    return sectionNumber;
}

UICollectionView左右切換,需要將pagingEnabled設(shè)置為YES。

界面上用到了UIPageControl,由于UICollectionView繼承UIScrollView。不同section的頁(yè)碼不一樣,所以在scrollViewDidEndDecelerating方法中更改UIPageControl的numberOfPages與currentPage。

/** 手指滑動(dòng)屏幕時(shí),視圖停止?jié)L動(dòng)會(huì)調(diào)用此方法 */
- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView {
    NSInteger collectionPage = scrollView.contentOffset.x/scrollView.frame.size.width;
    NSInteger aIndex = 0;
    NSInteger sectionIndex = 0;
    for (NSInteger index = 0; index < self.sectionPageNumbers.count; index ++) {
        NSString *sectionPage = [self.sectionPageNumbers objectAtIndex:index];
        aIndex = aIndex+[sectionPage integerValue];
        if (collectionPage >= 0 && collectionPage < aIndex) {
            sectionIndex = index;
            break;
        }
    }
    
    NSString *sectionCount = [self.sectionPageNumbers objectAtIndex:sectionIndex];
    NSLog(@"sectionCount:%@",sectionCount);
    
    NSInteger preCount = 0;
    for (NSInteger i = 0; i < sectionIndex; i++) {
        NSString *sectionPage = [self.sectionPageNumbers objectAtIndex:i];
        preCount = preCount + sectionPage.integerValue;
    }
    
    NSInteger sectionPageCount = sectionCount.integerValue;
    NSInteger sectionCurPage = collectionPage - preCount;
    
    NSLog(@"sectionPageCount:%ld",(long)sectionPageCount);
    NSLog(@"sectionCurPage:%ld",(long)sectionCurPage);

    self.emojiView.pageControl.numberOfPages = sectionPageCount;
    self.emojiView.pageControl.currentPage = sectionCurPage;
}

整體使用UICollectionView代理delegate方法代碼如下

#import "INEmotionPresenter.h"

#define kCustomEmotionScreenWidth [UIScreen mainScreen].bounds.size.width

@interface INCollectionSectionPageRange : NSObject

@property (nonatomic, assign) NSString *beginNumber;
@property (nonatomic, assign) NSString *endNumber;

@end

@implementation INCollectionSectionPageRange

@end



@implementation INEmotionPresenter

#pragma mark - 注冊(cè)cell
/**
 注冊(cè)cell
 */
- (void)registerCollectionCell {
    [self.emojiView.collectionView registerClass:[INEmotionSystemEmojiCell class] forCellWithReuseIdentifier:kEmotionEmojiSystemIdentifier];
    [self.emojiView.collectionView registerClass:[INEmotionCustomEmojiCell class] forCellWithReuseIdentifier:kEmotionEmojiCustomIdentifier];
}

#pragma mark - UICollectionViewDelegateFlowLayout
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
    UIEdgeInsets contentInset = collectionView.contentInset;
    
    NSInteger columnCount = 4;
    NSInteger rowCount = 2;
    if (indexPath.section == 0) {
        columnCount = 8;
        rowCount = 3;
    }
    CGFloat w = (CGRectGetWidth(collectionView.bounds) - contentInset.left - contentInset.right)/ columnCount;
    CGFloat h = (CGRectGetHeight(collectionView.bounds) - contentInset.top - contentInset.bottom)/rowCount;
    
    return CGSizeMake(w, h);
}

- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section {
    return 0.0;
}

- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout minimumInteritemSpacingForSectionAtIndex:(NSInteger)section {
    return 0.0;
}

#pragma mark - UICollectionViewDataSource
- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView {
    return 5;
}

- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
    
    NSInteger sectionNumber = 60;
    switch (section) {
        case 0:
            sectionNumber = 72;
            break;
        case 1:
            sectionNumber = 8;
            break;
        case 2:
            sectionNumber = 16;
            break;
        case 3:
            sectionNumber = 24;
            break;
        case 4:
            sectionNumber = 32;
            break;
            
        default:
            break;
    }
    return sectionNumber;
}

- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
    if (indexPath.section == 0) {
        //emoji表情
        INEmotionSystemEmojiCell *cell = (INEmotionSystemEmojiCell *)[collectionView dequeueReusableCellWithReuseIdentifier:kEmotionEmojiSystemIdentifier forIndexPath:indexPath];
        cell.emojiLabel.text = @"";
        cell.emojiLabel.text = [NSString stringWithFormat:@"%ld",(long)indexPath.item];
        cell.cellNumber = [NSString stringWithFormat:@"%ld",(long)indexPath.item];
        return cell;
    }
    
    //自定義表情貼圖
    INEmotionCustomEmojiCell *cell = (INEmotionCustomEmojiCell *)[collectionView dequeueReusableCellWithReuseIdentifier:kEmotionEmojiCustomIdentifier forIndexPath:indexPath];
    cell.cellNumber = [NSString stringWithFormat:@"%ld",(long)indexPath.item];
    return cell;
}

- (void)collectionView:(UICollectionView *)collectionView didEndDisplayingCell:(UICollectionViewCell *)cell forItemAtIndexPath:(NSIndexPath *)indexPath {
    
}

- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView {
    NSInteger collectionPage = scrollView.contentOffset.x/scrollView.frame.size.width;
    NSInteger aIndex = 0;
    NSInteger sectionIndex = 0;
    for (NSInteger index = 0; index < self.sectionPageNumbers.count; index ++) {
        NSString *sectionPage = [self.sectionPageNumbers objectAtIndex:index];
        aIndex = aIndex+[sectionPage integerValue];
        if (collectionPage >= 0 && collectionPage < aIndex) {
            sectionIndex = index;
            break;
        }
    }
    
    NSString *sectionCount = [self.sectionPageNumbers objectAtIndex:sectionIndex];
    NSLog(@"sectionCount:%@",sectionCount);
    
    NSInteger preCount = 0;
    for (NSInteger i = 0; i < sectionIndex; i++) {
        NSString *sectionPage = [self.sectionPageNumbers objectAtIndex:i];
        preCount = preCount + sectionPage.integerValue;
    }
    
    NSInteger sectionPageCount = sectionCount.integerValue;
    NSInteger sectionCurPage = collectionPage - preCount;
    
    NSLog(@"sectionPageCount:%ld",(long)sectionPageCount);
    NSLog(@"sectionCurPage:%ld",(long)sectionCurPage);

    self.emojiView.pageControl.numberOfPages = sectionPageCount;
    self.emojiView.pageControl.currentPage = sectionCurPage;
}

#pragma mark - SETTER/GETTER
- (NSMutableArray *)sectionPageNumbers {
    if (!_sectionPageNumbers) {
        _sectionPageNumbers = [NSMutableArray arrayWithCapacity:0];
        [_sectionPageNumbers addObject:@"3"];
        [_sectionPageNumbers addObject:@"1"];
        [_sectionPageNumbers addObject:@"2"];
        [_sectionPageNumbers addObject:@"3"];
        [_sectionPageNumbers addObject:@"4"];
    }
    return _sectionPageNumbers;
}

- (INEmotionConfig *)emojiConfig {
    if (!_emojiConfig) {
        _emojiConfig = [[INEmotionConfig alloc] init];
    }
    return _emojiConfig;
}

- (INEmotionInteractor *)emojiInteractor {
    if (!_emojiInteractor) {
        _emojiInteractor = [[INEmotionInteractor alloc] init];
    }
    return _emojiInteractor;
}

- (INEmotionView *)emojiView {
    if (!_emojiView) {
        _emojiView = [[INEmotionView alloc] initWithFrame:CGRectZero];
    }
    return _emojiView;
}

@end

2.3 實(shí)現(xiàn)表情的排列UICollectionViewFlowLayout

由于emoji表情需要3行8列,自定義貼圖表情需要2行4列排列。我這里實(shí)現(xiàn)一下UICollectionViewFlowLayout
要在layoutAttributesForItemAtIndexPath中區(qū)分,如果section為0,則為3行8列;否則為2行4列。

INEmotionFlowLayout.h

#import <UIKit/UIKit.h>

@interface INEmotionFlowLayout : UICollectionViewFlowLayout

- (UICollectionViewLayoutAttributes *)customLayoutAttributesForItemAtIndexPath:(NSIndexPath *)indexPath;

@end

INEmotionFlowLayout.m

#import "INEmotionFlowLayout.h"

#define kLayScreenWidth [UIScreen mainScreen].bounds.size.width

@interface INEmotionFlowLayout () <UICollectionViewDelegateFlowLayout>

@property (strong, nonatomic) NSMutableArray *allAttributes;

@property (nonatomic, assign) NSInteger currentRow;

@property (nonatomic, assign) NSInteger currentCol;

@end

@implementation INEmotionFlowLayout

-(instancetype)init
{
    if (self = [super init])
    {
        
    }
    return self;
}

- (void)prepareLayout
{
    [super prepareLayout];
    
    self.allAttributes = [NSMutableArray array];
    
    NSInteger sections = [self.collectionView numberOfSections];
    for (int i = 0; i < sections; i++)
    {
        NSMutableArray * tmpArray = [NSMutableArray array];
        NSUInteger count = [self.collectionView numberOfItemsInSection:i];
        
        for (NSUInteger j = 0; j<count; j++) {
            NSIndexPath *indexPath = [NSIndexPath indexPathForItem:j inSection:i];
            UICollectionViewLayoutAttributes *attributes = [self layoutAttributesForItemAtIndexPath:indexPath];
            [tmpArray addObject:attributes];
        }
        
        [self.allAttributes addObject:tmpArray];
    }
}

- (CGSize)collectionViewContentSize
{
    return [super collectionViewContentSize];
}

- (UICollectionViewLayoutAttributes *)layoutAttributesForItemAtIndexPath:(NSIndexPath *)indexPath
{
    NSUInteger item = indexPath.item;
    NSUInteger x;
    NSUInteger y;
    [self targetPositionWithItem:indexPath resultX:&x resultY:&y];
    NSUInteger item2 = [self originItemAtX:x y:y indexPath:indexPath];
    NSIndexPath *theNewIndexPath = [NSIndexPath indexPathForItem:item2 inSection:indexPath.section];
    
    UICollectionViewLayoutAttributes *theNewAttr = [super layoutAttributesForItemAtIndexPath:theNewIndexPath];
    theNewAttr.indexPath = indexPath;
    return theNewAttr;
}

- (NSArray<UICollectionViewLayoutAttributes *> *)layoutAttributesForElementsInRect:(CGRect)rect
{
    NSArray *attributes = [super layoutAttributesForElementsInRect:rect];
    
    NSMutableArray *tmp = [NSMutableArray array];
    
    for (UICollectionViewLayoutAttributes *attr in attributes) {
        for (NSMutableArray *attributes in self.allAttributes)
        {
            for (UICollectionViewLayoutAttributes *attr2 in attributes) {
                if (attr.indexPath.item == attr2.indexPath.item) {
                    [tmp addObject:attr2];
                    break;
                }
            }
            
        }
    }
    return tmp;
}


- (BOOL)shouldInvalidateLayoutForBoundsChange:(CGRect)newBounds
{
    return YES;
}

// 根據(jù) item 計(jì)算目標(biāo)item的位置
// x 橫向偏移  y 豎向偏移
- (void)targetPositionWithItem:(NSIndexPath *)indexPath
                       resultX:(NSUInteger *)x
                       resultY:(NSUInteger *)y
{
    NSInteger columnCount = 4;
    NSInteger rowCount = 2;
    if (indexPath.section == 0) {
        columnCount = 8;
        rowCount = 3;
    }
    
    NSInteger item = indexPath.item;
    
    NSUInteger page = item/(columnCount*rowCount);
    
    NSUInteger theX = item % columnCount + page * columnCount;
    NSUInteger theY = item / columnCount - page * rowCount;
    if (x != NULL) {
        *x = theX;
    }
    if (y != NULL) {
        *y = theY;
    }
    
}

// 根據(jù)偏移量計(jì)算item
- (NSUInteger)originItemAtX:(NSUInteger)x
                          y:(NSUInteger)y
                  indexPath:(NSIndexPath *)indexPath
{
    NSInteger columnCount = 4;
    NSInteger rowCount = 2;
    if (indexPath.section == 0) {
        columnCount = 8;
        rowCount = 3;
    }
    
    NSUInteger item = x * rowCount + y;
    return item;
}

- (UICollectionViewLayoutAttributes *)customLayoutAttributesForItemAtIndexPath:(NSIndexPath *)indexPath {
    return [self layoutAttributesForItemAtIndexPath:indexPath];
}

@end

2.4 emoji表情的UICollectionViewCell

繼承UICollectionViewCell實(shí)現(xiàn)INEmotionSystemEmojiCell表情

INEmotionSystemEmojiCell.h

#import <UIKit/UIKit.h>
#import "UIColor+Addition.h"

@interface INEmotionSystemEmojiCell : UICollectionViewCell

@property (nonatomic, strong) UIImageView *emojiImageView;

@property (nonatomic, strong) UILabel *emojiLabel;

/**
 cell的序號(hào)
 */
@property (nonatomic, strong) NSString *cellNumber;

/**
 按照序號(hào),從小到大

 @param cell cell
 @return 排序
 */
- (NSComparisonResult)sortAscCells:(INEmotionSystemEmojiCell *)cell;

@end

INEmotionSystemEmojiCell.m

#import "INEmotionSystemEmojiCell.h"

static CGFloat kEmotionEmojiSize = 40.0;

@implementation INEmotionSystemEmojiCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.emojiImageView = [[UIImageView alloc] initWithFrame:CGRectMake((CGRectGetWidth(self.bounds) - kEmotionEmojiSize)/2, (CGRectGetHeight(self.bounds) - kEmotionEmojiSize)/2, kEmotionEmojiSize, kEmotionEmojiSize)];
        self.emojiImageView.backgroundColor = [UIColor randomColor];
        self.emojiImageView.layer.cornerRadius = kEmotionEmojiSize/2;
        self.emojiImageView.layer.masksToBounds = YES;
        [self addSubview:self.emojiImageView];
        
        self.emojiLabel = [[UILabel alloc] initWithFrame:CGRectMake((CGRectGetWidth(self.bounds) - kEmotionEmojiSize)/2, (CGRectGetHeight(self.bounds) - kEmotionEmojiSize)/2, kEmotionEmojiSize, kEmotionEmojiSize)];
        self.emojiLabel.textColor = [UIColor grayColor];
        self.emojiLabel.textAlignment = NSTextAlignmentCenter;
        [self addSubview:self.emojiLabel];
    }
    return self;
}

- (void)layoutSubviews {
    [super layoutSubviews];
    self.emojiImageView.frame = CGRectMake((CGRectGetWidth(self.bounds) - kEmotionEmojiSize)/2, (CGRectGetHeight(self.bounds) - kEmotionEmojiSize)/2, kEmotionEmojiSize, kEmotionEmojiSize);
    self.emojiLabel.frame = CGRectMake((CGRectGetWidth(self.bounds) - kEmotionEmojiSize)/2, (CGRectGetHeight(self.bounds) - kEmotionEmojiSize)/2, kEmotionEmojiSize, kEmotionEmojiSize);
}

/**
 按照序號(hào),從小到大
 
 @param cell cell
 @return 排序
 */
- (NSComparisonResult)sortAscCells:(INEmotionSystemEmojiCell *)cell {
    //先按照時(shí)間排序
    NSComparisonResult result = [self.cellNumber compare:cell.cellNumber];
    return  result;
}

@end

2.5 自定義貼圖表情的UICollectionViewCell

INEmotionCustomEmojiCell.h

#import <UIKit/UIKit.h>
#import "UIColor+Addition.h"

@interface INEmotionCustomEmojiCell : UICollectionViewCell

@property (nonatomic, strong) UIImageView *emojiImageView;

/**
 cell的序號(hào)
 */
@property (nonatomic, strong) NSString *cellNumber;

/**
 按照序號(hào),從小到大
 
 @param cell cell
 @return 排序
 */
- (NSComparisonResult)sortAscCells:(INEmotionCustomEmojiCell *)cell;

@end

INEmotionCustomEmojiCell.m

#import "INEmotionCustomEmojiCell.h"

static CGFloat kCustomEmotionEmojiSize = 80.0;

@implementation INEmotionCustomEmojiCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.emojiImageView = [[UIImageView alloc] initWithFrame:CGRectMake((CGRectGetWidth(self.bounds) - kCustomEmotionEmojiSize)/2, (CGRectGetHeight(self.bounds) - kCustomEmotionEmojiSize)/2, kCustomEmotionEmojiSize, kCustomEmotionEmojiSize)];
        self.emojiImageView.backgroundColor = [UIColor randomColor];
        self.emojiImageView.layer.cornerRadius = 4;
        self.emojiImageView.layer.masksToBounds = YES;
        [self addSubview:self.emojiImageView];
    }
    return self;
}

- (void)layoutSubviews {
    [super layoutSubviews];
    self.emojiImageView.frame = CGRectMake((CGRectGetWidth(self.bounds) - kCustomEmotionEmojiSize)/2, (CGRectGetHeight(self.bounds) - kCustomEmotionEmojiSize)/2, kCustomEmotionEmojiSize, kCustomEmotionEmojiSize);
}

/**
 按照序號(hào),從小到大
 
 @param cell cell
 @return 排序
 */
- (NSComparisonResult)sortAscCells:(INEmotionCustomEmojiCell *)cell {
    //先按照時(shí)間排序
    NSComparisonResult result = [self.cellNumber compare:cell.cellNumber];
    return  result;
}

@end

至此整個(gè)效果的代碼實(shí)現(xiàn)完了。

三、小結(jié)

iOS開發(fā)-聊天emoji表情與自定義動(dòng)圖表情左右滑動(dòng)控件.使用UICollectionView實(shí)現(xiàn)。

學(xué)習(xí)記錄,每天不停進(jìn)步。文章來源地址http://www.zghlxwxcb.cn/news/detail-616733.html

到了這里,關(guān)于iOS開發(fā)-聊天emoji表情與自定義動(dòng)圖表情左右滑動(dòng)控件的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場(chǎng)。本站僅提供信息存儲(chǔ)空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請(qǐng)注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請(qǐng)點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • HTML常用表情Emoji?♂?和Emoji參考手冊(cè)

    HTML常用表情Emoji?♂?和Emoji參考手冊(cè)

    HTML表情可以用來在網(wǎng)頁(yè)中插入各種表情符號(hào)圖標(biāo),豐富了網(wǎng)頁(yè)表現(xiàn)形式和視覺效果。下面是一些常用HTML表情代碼大全?? ??????????????????????????????????? ???????♂?????????????????????????????????????????????????????????

    2024年02月13日
    瀏覽(22)
  • HTML emoji整理 表情符號(hào)

    HTML emoji整理 表情符號(hào)

    參考鏈接: https://blog.csdn.net/qq_53679247/article/details/127383775 https://chat.xutongbao.top/#/ai/chat?

    2024年02月09日
    瀏覽(30)
  • Unity UGUI TextMeshPro實(shí)現(xiàn)輸入中文和表情包(Emoji)表情

    Unity UGUI TextMeshPro實(shí)現(xiàn)輸入中文和表情包(Emoji)表情

    目錄 實(shí)現(xiàn)中文顯示 準(zhǔn)備工作 1、打開Window——TextMeshPro——FontAssetCreator 2、把字體文件放入SourceFont中 3、把CharacterSet改為Characters from File 4、把字體庫(kù)文件放入Characters File 5、設(shè)置好參數(shù)點(diǎn)擊Generate Font Atlas等待完成后保存 6、把生成后保存的字體文件退拽到Font Asset即可 效果演

    2024年01月18日
    瀏覽(24)
  • Unity中使用TextMeshPro打出Emoji表情

    Unity中使用TextMeshPro打出Emoji表情

    最近遇到一個(gè)需求,在聊天框中支持用戶的Emoji輸入,查了半天資料沒有一個(gè)能說清楚的,于是自己研究琢磨了下。 最終效果 最終效果可以在APP輸入框中使用系統(tǒng)的輸入法輸入emoji表情并顯示,如下 1.1 準(zhǔn)備好emoji素材 找到emoji圖片,注意需要是 unicode.png 格式命名的。github上

    2024年01月18日
    瀏覽(36)
  • ChatGPT實(shí)現(xiàn)markdown 格式與 emoji 表情

    ChatGPT實(shí)現(xiàn)markdown 格式與 emoji 表情

    書寫文章時(shí),巧妙的使用一些小圖標(biāo),可以給文章增加不少的靈動(dòng)感,讀者也會(huì)感覺更加輕松。恰當(dāng)?shù)膱D標(biāo)也能增進(jìn)讀者對(duì)內(nèi)容的理解。ChatGPT 目前不能直接聯(lián)網(wǎng),但可以使用 emoji 表情文字來達(dá)到類似的效果。我們?cè)诓簧?GitHub 的項(xiàng)目介紹和個(gè)人介紹頁(yè)面上,都可以看到在列

    2024年02月07日
    瀏覽(27)
  • 表情符號(hào)(emoji)大全,只此一文便夠了

    表情符號(hào)(emoji)大全,只此一文便夠了

    本文由 大俠(AhcaoZhu)原創(chuàng),轉(zhuǎn)載請(qǐng)聲明。 鏈接: https://blog.csdn.net/Ahcao2008 全文介紹 emoji 表情符號(hào)的相關(guān)知識(shí)、資源、輸入等,以及符號(hào)收集,便于復(fù)制粘貼。 建議收藏,取用方便。 【原創(chuàng):AhcaoZhu大俠】 ????????????????????????????????????????????????

    2024年02月02日
    瀏覽(19)
  • 在Unity的UGUI中使用EMOJI表情

    在Unity的UGUI中使用EMOJI表情

    項(xiàng)目中遇到有玩家名稱里面有emoji,需要顯示,于是開始著手弄這個(gè)功能。 查了各種資料,發(fā)現(xiàn)ugui好像弄不了。先是在github上看了 https://github.com/mcraiha/Unity-UI-emoji 但是下載下來用不了,然后在 csdn 上也各種看了下,都寫的有板有眼的但是用2021.3的unity都跑不出來博客里描述的

    2024年01月16日
    瀏覽(23)
  • 發(fā)現(xiàn)一個(gè)好玩的東西:Markdown 使用 Emoji 表情

    發(fā)現(xiàn)一個(gè)好玩的東西:Markdown 使用 Emoji 表情

    有兩種方法可以將表情符號(hào)添加到Markdown文件中: 將表情符號(hào)復(fù)制并粘貼到Markdown格式的文本中 或者鍵入emoji shortcodes。 在大多數(shù)情況下,您可以簡(jiǎn)單地從Emojipedia等來源復(fù)制表情符號(hào)并將其粘貼到文檔中。許多Markdown應(yīng)用程序會(huì)自動(dòng)以Markdown格式的文本顯示表情符號(hào)。從Markd

    2024年02月06日
    瀏覽(29)
  • Java 21增強(qiáng)對(duì)Emoji表情符號(hào)的處理了

    現(xiàn)一個(gè) Java 21 中有意思的東西! 在 java.Lang.Character 類中增加了用于確定字符是否為 Emoji 表情符號(hào)的 API,主要包含下面六個(gè)新的靜態(tài)方法: 這些靜態(tài)方法通過接收字符的 codePoint 來判斷是否為表情符號(hào)來返回 boolean 值。 所以,我們可以用 isEmoji 方法來判斷字符串中是否有表情

    2024年02月05日
    瀏覽(24)
  • 【動(dòng)畫進(jìn)階】有意思的 Emoji 3D 表情切換效果

    【動(dòng)畫進(jìn)階】有意思的 Emoji 3D 表情切換效果

    最近,群里面的同學(xué)發(fā)了這么一個(gè)非常有意思是動(dòng)畫效果: 原效果地址 -- CodePen Demo -- Letter Hop 當(dāng)然,原效果,主要使用了 GSAP 動(dòng)畫庫(kù)以及一個(gè) 3D 文字 JavaScript 庫(kù): 但是,這個(gè)效果,其實(shí)本身并不復(fù)雜。 本文,我們將不借助任何動(dòng)畫庫(kù),嘗試用最簡(jiǎn)單的 CSS 和 JavaScript 代碼還

    2024年02月14日
    瀏覽(24)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請(qǐng)作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包