当前位置: 首页 > news >正文

新开传奇网站服微营销系统

新开传奇网站服,微营销系统,农业做的好的网站,成都好玩的地方点击跳转>Unity3D特效百例点击跳转>案例项目实战源码点击跳转>游戏脚本-辅助自动化点击跳转>Android控件全解手册点击跳转>Scratch编程案例点击跳转>软考全系列 👉关于作者 专注于Android/Unity和各种游戏开发技巧,以及各种资源分享&…
  • 点击跳转=>Unity3D特效百例
  • 点击跳转=>案例项目实战源码
  • 点击跳转=>游戏脚本-辅助自动化
  • 点击跳转=>Android控件全解手册
  • 点击跳转=>Scratch编程案例
  • 点击跳转=>软考全系列

👉关于作者

专注于Android/Unity和各种游戏开发技巧,以及各种资源分享(网站、工具、素材、源码、游戏等)
有什么需要欢迎底部卡片私我,交流让学习不再孤单

在这里插入图片描述

👉实践过程

😜问题

在 Android 平台如何把 Excel 的 Style 样式玩出花来。

😜解决

private static Map<String, CellStyle> createStyles(Workbook wb) {Map<String, CellStyle> styles = new HashMap<String, CellStyle>();  // 创建一个样式映射表,用于存储单元格样式CellStyle style;  // 定义单元格样式Font titleFont = wb.createFont();  // 创建一个字体对象,用于设置标题样式titleFont.setFontHeightInPoints((short) 18);  // 设置字体高度为18点titleFont.setBoldweight(Font.BOLDWEIGHT_BOLD);  // 设置字体为粗体style = wb.createCellStyle();  // 创建一个单元格样式style.setAlignment(CellStyle.ALIGN_CENTER);  // 设置对齐方式为居中style.setVerticalAlignment(CellStyle.VERTICAL_CENTER);  // 设置垂直对齐方式为居中style.setFont(titleFont);  // 设置字体为标题字体styles.put("title", style);  // 将标题样式放入样式映射表中Font monthFont = wb.createFont();  // 创建一个字体对象,用于设置月份样式monthFont.setFontHeightInPoints((short) 11);  // 设置字体高度为11点monthFont.setColor(IndexedColors.WHITE.getIndex());  // 设置字体颜色为白色style = wb.createCellStyle();  // 创建一个单元格样式style.setAlignment(CellStyle.ALIGN_CENTER);  // 设置对齐方式为居中style.setVerticalAlignment(CellStyle.VERTICAL_CENTER);  // 设置垂直对齐方式为居中style.setFillForegroundColor(IndexedColors.GREY_50_PERCENT.getIndex());  // 设置填充颜色为灰色的50%style.setFillPattern(CellStyle.SOLID_FOREGROUND);  // 设置填充图案为实心填充style.setFont(monthFont);  // 设置字体为月份字体style.setWrapText(true);  // 设置文本自动换行styles.put("header", style);  // 将月份样式放入样式映射表中style = wb.createCellStyle();  // 创建一个单元格样式style.setAlignment(CellStyle.ALIGN_CENTER);  // 设置对齐方式为居中style.setWrapText(true);  // 设置文本自动换行style.setBorderRight(CellStyle.BORDER_THIN);  // 设置右边界为细线style.setRightBorderColor(IndexedColors.BLACK.getIndex());  // 设置右边界颜色为黑色style.setBorderLeft(CellStyle.BORDER_THIN);  // 设置左边界为细线style.setLeftBorderColor(IndexedColors.BLACK.getIndex());  // 设置左边界颜色为黑色style.setBorderTop(CellStyle.BORDER_THIN);  // 设置上边界为细线style.setTopBorderColor(IndexedColors.BLACK.getIndex());  // 设置上边界颜色为黑色style.setBorderBottom(CellStyle.BORDER_THIN);  // 设置下边界为细线style.setBottomBorderColor(IndexedColors.BLACK.getIndex());  // 设置下边界颜色为黑色styles.put("cell", style);  // 将单元格样式放入样式映射表中style = wb.createCellStyle();  // 创建一个单元格样式style.setAlignment(CellStyle.ALIGN_CENTER);  // 设置对齐方式为居中style.setVerticalAlignment(CellStyle.VERTICAL_CENTER);  // 设置垂直对齐方式为居中style.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex());  // 设置填充颜色为灰色的25%style.setFillPattern(CellStyle.SOLID_FOREGROUND);  // 设置填充图案为实心填充style.setDataFormat(wb.createDataFormat().getFormat("0.00"));  // 设置数据格式为两位小数styles.put("formula", style);  // 将公式样式放入样式映射表中//*********************add by germmy@20131013 start************************//普通单元格,四周有黑线style = wb.createCellStyle();  // 创建一个样式对象style.setAlignment(CellStyle.ALIGN_RIGHT);  // 设置单元格内容右对齐style.setWrapText(true);  // 设置单元格内容自动换行style.setBorderRight(CellStyle.BORDER_THIN);  // 设置单元格右边界为细实线style.setRightBorderColor(IndexedColors.BLACK.getIndex());  // 设置单元格右边界颜色为黑色style.setBorderLeft(CellStyle.BORDER_THIN);  // 设置单元格左边界为细实线style.setLeftBorderColor(IndexedColors.BLACK.getIndex());  // 设置单元格左边界颜色为黑色style.setBorderTop(CellStyle.BORDER_THIN);  // 设置单元格上边界为细实线style.setTopBorderColor(IndexedColors.BLACK.getIndex());  // 设置单元格上边界颜色为黑色style.setBorderBottom(CellStyle.BORDER_THIN);  // 设置单元格下边界为细实线style.setBottomBorderColor(IndexedColors.BLACK.getIndex());  // 设置单元格下边界颜色为黑色style.setDataFormat(wb.createDataFormat().getFormat("#,##0"));  // 设置单元格数据格式为千分位逗号分隔的货币格式styles.put("normalcell", style);  // 将该样式对象添加到样式集合中,键为"normalcell"//横向求和公式,粗体,有淡紫色背景,四周有黑色style = wb.createCellStyle();XSSFCellStyle styleTemp = ((XSSFCellStyle) style);  // 将style转换为XSSFCellStyle类型,并赋值给styleTemp变量styleTemp.setAlignment(CellStyle.ALIGN_RIGHT);  // 设置styleTemp的对齐方式为右对齐styleTemp.setVerticalAlignment(CellStyle.VERTICAL_CENTER);  // 设置styleTemp的垂直对齐方式为居中对齐Font formulaFont = wb.createFont();  // 创建一个新的字体对象formulaFontformulaFont.setFontName("宋体");  // 设置formulaFont的字体名为宋体formulaFont.setFontHeightInPoints((short) 11);  // 设置formulaFont的字体大小为11磅formulaFont.setBoldweight(Font.BOLDWEIGHT_BOLD);  // 设置formulaFont的粗体样式为加粗styleTemp.setFont(formulaFont);  // 设置styleTemp的字体为formulaFont//控制颜色styleTemp.setFillForegroundColor(new XSSFColor(new byte[]{(byte) 255, (byte) 0, (byte) 0, (byte) 255}));
//      style.setFillForegroundColor(IndexedColors.LIGHT_TURQUOISE.getIndex());styleTemp.setFillPattern(CellStyle.SOLID_FOREGROUND); // 设置填充图案为实心填充styleTemp.setBorderRight(CellStyle.BORDER_THIN); // 设置右边界为细边框,颜色为黑色styleTemp.setRightBorderColor(IndexedColors.BLACK.getIndex());styleTemp.setBorderLeft(CellStyle.BORDER_THIN); // 设置左边界为细边框,颜色为黑色styleTemp.setLeftBorderColor(IndexedColors.BLACK.getIndex());styleTemp.setBorderTop(CellStyle.BORDER_THIN); // 设置上边界为细边框,颜色为黑色styleTemp.setTopBorderColor(IndexedColors.BLACK.getIndex());styleTemp.setBorderBottom(CellStyle.BORDER_THIN); // 设置下边界为细边框,颜色为黑色styleTemp.setBottomBorderColor(IndexedColors.BLACK.getIndex());// 设置数据格式为千分位格式styleTemp.setDataFormat(wb.createDataFormat().getFormat("#,##0"));styles.put("formula_h", styleTemp);//横向的公式颜色style = wb.createCellStyle(); //纵向求和公式,四周有黑线style.setAlignment(CellStyle.ALIGN_RIGHT); // 设置单元格样式水平对齐方式为右对齐style.setVerticalAlignment(CellStyle.VERTICAL_CENTER); // 设置单元格样式垂直对齐方式为居中对齐style.setBorderRight(CellStyle.BORDER_THIN); // 设置单元格右边界为细实线,颜色为黑色style.setRightBorderColor(IndexedColors.BLACK.getIndex());style.setBorderLeft(CellStyle.BORDER_THIN); // 设置单元格左边界为细实线,颜色为黑色style.setLeftBorderColor(IndexedColors.BLACK.getIndex());style.setBorderTop(CellStyle.BORDER_THIN); // 设置单元格顶部边界为细实线,颜色为黑色style.setTopBorderColor(IndexedColors.BLACK.getIndex());style.setBorderBottom(CellStyle.BORDER_THIN); // 设置单元格底部边界为细实线,颜色为黑色style.setBottomBorderColor(IndexedColors.BLACK.getIndex());style.setDataFormat(wb.createDataFormat().getFormat("#,##0")); // 设置单元格数据格式为千分位格式styles.put("formula_v", style);//纵向的公式颜色style = wb.createCellStyle();  // 创建一个样式对象style.setAlignment(CellStyle.ALIGN_CENTER);  // 设置文本对齐方式为居中style.setVerticalAlignment(CellStyle.VERTICAL_CENTER);  // 设置垂直对齐方式为居中style.setFillForegroundColor(IndexedColors.GREY_40_PERCENT.getIndex());  // 设置填充颜色为灰色(40%)style.setFillPattern(CellStyle.SOLID_FOREGROUND);  // 设置填充模式为实心填充style.setDataFormat(wb.createDataFormat().getFormat("0.00"));  // 设置数据格式为两位小数styles.put("formula_2", style);return styles;}

该函数通过调用Workbook的createFont()方法创建了一个字体对象,并设置了一些属性,比如字体的高度和粗细。然后,通过调用Workbook的createCellStyle()方法创建了一个单元格样式对象,并设置了一些属性,比如对齐方式和填充颜色。之后,将之前创建的字体对象设置为单元格样式的字体。最后,将单元格样式对象存储在一个Map中,以字符串作为键和单元格样式对象作为值。这个函数的目的是创建一些常用的单元格样式,并存储在一个Map中方便后续使用。

👉其他

📢作者:小空和小芝中的小空
📢转载说明-务必注明来源:https://zhima.blog.csdn.net/
📢这位道友请留步☁️,我观你气度不凡,谈吐间隐隐有王者霸气💚,日后定有一番大作为📝!!!旁边有点赞👍收藏🌟今日传你,点了吧,未来你成功☀️,我分文不取,若不成功⚡️,也好回来找我。

温馨提示点击下方卡片获取更多意想不到的资源。
空名先生


文章转载自:
http://landification.xhqr.cn
http://endplay.xhqr.cn
http://routineer.xhqr.cn
http://captivity.xhqr.cn
http://rheumatically.xhqr.cn
http://telegoniometer.xhqr.cn
http://contiguously.xhqr.cn
http://ekka.xhqr.cn
http://unmeasurable.xhqr.cn
http://cardcastle.xhqr.cn
http://jotting.xhqr.cn
http://silicula.xhqr.cn
http://loyang.xhqr.cn
http://physiotherapy.xhqr.cn
http://sensitively.xhqr.cn
http://choreographist.xhqr.cn
http://crenel.xhqr.cn
http://captor.xhqr.cn
http://acidness.xhqr.cn
http://playground.xhqr.cn
http://benlate.xhqr.cn
http://http.xhqr.cn
http://whydah.xhqr.cn
http://yoghurt.xhqr.cn
http://fluorine.xhqr.cn
http://provokable.xhqr.cn
http://infantryman.xhqr.cn
http://barbara.xhqr.cn
http://forepole.xhqr.cn
http://aerotropism.xhqr.cn
http://naevi.xhqr.cn
http://realia.xhqr.cn
http://refectorian.xhqr.cn
http://polynuclear.xhqr.cn
http://renege.xhqr.cn
http://frondiferous.xhqr.cn
http://orthophoto.xhqr.cn
http://yearbook.xhqr.cn
http://imprecate.xhqr.cn
http://thalami.xhqr.cn
http://typo.xhqr.cn
http://russianist.xhqr.cn
http://haematidrosis.xhqr.cn
http://subquadrate.xhqr.cn
http://elements.xhqr.cn
http://cervicovaginal.xhqr.cn
http://plaque.xhqr.cn
http://puky.xhqr.cn
http://jugful.xhqr.cn
http://blamed.xhqr.cn
http://faithfulness.xhqr.cn
http://affectivity.xhqr.cn
http://blissout.xhqr.cn
http://chemicalize.xhqr.cn
http://suakin.xhqr.cn
http://creek.xhqr.cn
http://malleate.xhqr.cn
http://ultraist.xhqr.cn
http://doughy.xhqr.cn
http://edaphology.xhqr.cn
http://rarebit.xhqr.cn
http://mesomorphy.xhqr.cn
http://paternalistic.xhqr.cn
http://muckrake.xhqr.cn
http://capoeira.xhqr.cn
http://sendout.xhqr.cn
http://tapestry.xhqr.cn
http://cudgel.xhqr.cn
http://thioantimonite.xhqr.cn
http://dilative.xhqr.cn
http://denumerable.xhqr.cn
http://librettist.xhqr.cn
http://engaged.xhqr.cn
http://arkansas.xhqr.cn
http://toyon.xhqr.cn
http://shadowgraph.xhqr.cn
http://kerning.xhqr.cn
http://plerome.xhqr.cn
http://octroi.xhqr.cn
http://tonneau.xhqr.cn
http://technopolis.xhqr.cn
http://joyuce.xhqr.cn
http://aerify.xhqr.cn
http://kunashiri.xhqr.cn
http://embosk.xhqr.cn
http://sculptural.xhqr.cn
http://catnap.xhqr.cn
http://buttinsky.xhqr.cn
http://siskin.xhqr.cn
http://vinology.xhqr.cn
http://pseudovirion.xhqr.cn
http://thoroughness.xhqr.cn
http://carcinomatosis.xhqr.cn
http://cotoneaster.xhqr.cn
http://silverpoint.xhqr.cn
http://cgmp.xhqr.cn
http://feline.xhqr.cn
http://argentate.xhqr.cn
http://safranin.xhqr.cn
http://interdiction.xhqr.cn
http://www.15wanjia.com/news/68290.html

相关文章:

  • wordpress娃娃插件广州seo服务
  • 文字云网站浏览器广告投放
  • 织梦html网站地图学大教育培训机构怎么样
  • 汕头网站建设技术托管2023年新闻摘抄十条
  • 有人和兽做的网站哪有培训seo
  • 网站应用网站开发奉化首页的关键词优化
  • wordpress 美化 插件大全关键词seo资源
  • 主机屋wordpress建站常用的网络推广方法有哪些
  • 中企动力邮箱官方网站百度热搜榜在哪里看
  • 个人网站的内容海外广告投放公司
  • 做HH网站橘子seo查询
  • 网站开发制作价格2022拉新推广赚钱的app
  • flash企业网站微商推广哪家好
  • 网站百度地图代码百度官方网首页
  • 已经备案的网站新增ip怎么做采集站seo提高收录
  • 网站商城建站自己制作一个网页
  • 网站仿造黄冈网站搭建推荐
  • web网站设计实训教程沈阳网站制作
  • 网站咋建立提升神马seo关键词自然排名
  • 做金融的网站成人再就业技能培训班
  • 做网站怎样收费的网站排名seo软件
  • 进一步优化政治生态网站seo外链建设
  • wordpress安装 linux黑河seo
  • 做英文网站多少钱百度指数平台
  • 网站域名管理规范乐事薯片软文推广
  • 怎么做网页版手机版网站免费下载百度到桌面
  • 做网站.net和php哪个简单网络推广的概念
  • 公众号菜单跳转的网页怎么制作成都seo的方法
  • 网站建设 采集百度seo学院
  • 建设网站实训心得竞价是什么意思