美文网首页
简书黑色代码块设置

简书黑色代码块设置

作者: 杰小冷_4957 | 来源:发表于2019-07-22 14:36 被阅读0次

简书代码块黑色设置

这一部分网上方法很多,看自己怎么理解了,我来说下一个比较简单的方式以及我自己遇到过的坑。

1、新建文章之前先选择Markdown编辑器。如果是新建后在选择编辑器不生效。
2、中文和英文输入法不影响。
3、输入的时候先输入三个空格或者4个空格就可以生成代码块。

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
if (indexPath.section == 0) {
    BannerTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"BannerTableViewCell" forIndexPath:indexPath];
    cell.layer.cornerRadius  = 3;
    cell.layer.masksToBounds = YES;
    return cell;
}else{
    SuoTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"SuoTableViewCell" forIndexPath:indexPath];
    if (self.dataArr.count > 0) {
        NSDictionary *dic = self.dataArr[indexPath.section-1];
        NSArray *arr = dic[@"list"];
        if (arr.count > 0) {
            NSDictionary *dicdata = arr[indexPath.row];
            if ([[NSString stringWithFormat:@"%@",dicdata[@"lockAlias"]] isEqualToString:@"<null>"] ) {
                cell.name.text = @"门锁";
            }else{
                cell.name.text =  [NSString stringWithFormat:@"%@",dicdata[@"lockAlias"]];
            }
            
            NSArray *arr = @[@"办公室门锁",@"大门锁",@"防盗门锁"];
            
            NSString *index = dicdata[@"iconIndex"];
            
            cell.headImg.image = [UIImage imageNamed:arr[index.intValue]];
        }
    }
    return cell;
}

return nil;

}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
if (indexPath.section == 0) {
    BannerTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"BannerTableViewCell" forIndexPath:indexPath];
    cell.layer.cornerRadius  = 3;
    cell.layer.masksToBounds = YES;
    return cell;

中间插入不影响

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
if (indexPath.section == 0) {
    BannerTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"BannerTableViewCell" forIndexPath:indexPath];
    cell.layer.cornerRadius  = 3;
    cell.layer.masksToBounds = YES;
    return cell;


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
if (indexPath.section == 0) {
    BannerTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"BannerTableViewCell" forIndexPath:indexPath];
    cell.layer.cornerRadius  = 3;
    cell.layer.masksToBounds = YES;
    return cell;
}else{
    SuoTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"SuoTableViewCell" forIndexPath:indexPath];
    if (self.dataArr.count > 0) {
        NSDictionary *dic = self.dataArr[indexPath.section-1];
        NSArray *arr = dic[@"list"];
        if (arr.count > 0) {
            NSDictionary *dicdata = arr[indexPath.row];
            if ([[NSString stringWithFormat:@"%@",dicdata[@"lockAlias"]] isEqualToString:@"<null>"] ) {
                cell.name.text = @"门锁";
            }else{
                cell.name.text =  [NSString stringWithFormat:@"%@",dicdata[@"lockAlias"]];
            }
            
            NSArray *arr = @[@"办公室门锁",@"大门锁",@"防盗门锁"];
            
            NSString *index = dicdata[@"iconIndex"];
            
            cell.headImg.image = [UIImage imageNamed:arr[index.intValue]];
        }
    }
    return cell;
}

return nil;

}

复制代码的时候上面 }不在代码块里面的时候,在这个前面输入三个或者四个空格。

相关文章

  • 简书黑色代码块设置

    简书代码块黑色设置 这一部分网上方法很多,看自己怎么理解了,我来说下一个比较简单的方式以及我自己遇到过的坑。 1、...

  • 简书插入代码块的方法

    目录 简书常用编辑器设置 实现代码块的几种方式代码引用代码块 简书常用编辑器设置 首先需要在简书的设置中切换常用编...

  • 简书代码块设置

    简书上文章设置黑色的代码块, 很容易区分代码与内容, 同时也给人一种专业的感觉 如果你想知道怎么设置出来的? ...

  • 使用MarkDown进行简书编辑

    1.简书设置 2.代码块 如

  • 简书的使用,编写代码块,明确清晰

    1、小白使用简书代码块看这里,大神就不用了 首先在简书设置里面设置成markDown的编辑模式 2、在编写代码块的...

  • 简书插入代码块的方法

    引言 初入简书,作为一个具有代码强迫症的程序员,让我们开始学习如何在简书中插入代码块。 目录 简书常用编辑器设置 ...

  • 2020-11-19

    引言 初入简书,作为一个具有代码强迫症的程序员,让我们开始学习如何在简书中插入代码块。 目录 简书常用编辑器设置 ...

  • 如何在简书中插入代码块

    简书是支持Markdown的,所以想要简单的插入代码块,只需在简书中先设置支持Markdown,即可使用Markd...

  • 如何在简书中插入代码块

    简书是支持Markdown的,所以想要简单的插入代码块,只需在简书中先设置支持Markdown,即可使用Markd...

  • 简书如何插入漂亮的代码块

    作为一个程序猿,一般需要掌握如何插入漂亮规则的代码块,现在我简单介绍一下如何插入代码块。首先需要在简书的设置栏更改...

网友评论

      本文标题:简书黑色代码块设置

      本文链接:https://www.haomeiwen.com/subject/xtcwlctx.html