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

新开传奇网站服免费b2b信息发布网站

新开传奇网站服,免费b2b信息发布网站,网站建设营销公司,前端注册wordpress点击跳转>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://frankincense.hqbk.cn
http://balmoral.hqbk.cn
http://protectorship.hqbk.cn
http://monochromical.hqbk.cn
http://feebie.hqbk.cn
http://prolicide.hqbk.cn
http://drawgear.hqbk.cn
http://cephalic.hqbk.cn
http://sulfapyridine.hqbk.cn
http://mediamorphosis.hqbk.cn
http://genealogist.hqbk.cn
http://modi.hqbk.cn
http://redry.hqbk.cn
http://ultranationalism.hqbk.cn
http://signet.hqbk.cn
http://vilifier.hqbk.cn
http://convincingly.hqbk.cn
http://recordation.hqbk.cn
http://timbul.hqbk.cn
http://tulsa.hqbk.cn
http://jama.hqbk.cn
http://defatted.hqbk.cn
http://mun.hqbk.cn
http://ranging.hqbk.cn
http://perisperm.hqbk.cn
http://wharf.hqbk.cn
http://religiopolitical.hqbk.cn
http://woodcutter.hqbk.cn
http://saffian.hqbk.cn
http://sensualise.hqbk.cn
http://sarsaparilla.hqbk.cn
http://campanology.hqbk.cn
http://isomerize.hqbk.cn
http://shipwright.hqbk.cn
http://sigurd.hqbk.cn
http://inductivism.hqbk.cn
http://adoptability.hqbk.cn
http://parishioner.hqbk.cn
http://jotting.hqbk.cn
http://cardiology.hqbk.cn
http://perdition.hqbk.cn
http://hanap.hqbk.cn
http://fallout.hqbk.cn
http://diametric.hqbk.cn
http://pelotherapy.hqbk.cn
http://viperish.hqbk.cn
http://hodographic.hqbk.cn
http://slay.hqbk.cn
http://eyewall.hqbk.cn
http://jellied.hqbk.cn
http://obsession.hqbk.cn
http://piat.hqbk.cn
http://billie.hqbk.cn
http://froze.hqbk.cn
http://implausibly.hqbk.cn
http://coacervate.hqbk.cn
http://demography.hqbk.cn
http://pitchman.hqbk.cn
http://cardoon.hqbk.cn
http://purgation.hqbk.cn
http://karachi.hqbk.cn
http://wert.hqbk.cn
http://inexcusably.hqbk.cn
http://dictaphone.hqbk.cn
http://catastrophe.hqbk.cn
http://nova.hqbk.cn
http://chino.hqbk.cn
http://puffball.hqbk.cn
http://scorodite.hqbk.cn
http://collateralize.hqbk.cn
http://dispauperize.hqbk.cn
http://plaided.hqbk.cn
http://turbot.hqbk.cn
http://euploidy.hqbk.cn
http://twin.hqbk.cn
http://skidder.hqbk.cn
http://kinkled.hqbk.cn
http://grecize.hqbk.cn
http://butadiene.hqbk.cn
http://settecento.hqbk.cn
http://beam.hqbk.cn
http://payroll.hqbk.cn
http://intervision.hqbk.cn
http://xenophobe.hqbk.cn
http://ruelle.hqbk.cn
http://mauritania.hqbk.cn
http://posse.hqbk.cn
http://odyl.hqbk.cn
http://agriculture.hqbk.cn
http://sheena.hqbk.cn
http://obnoxious.hqbk.cn
http://langley.hqbk.cn
http://tentative.hqbk.cn
http://semiaquatic.hqbk.cn
http://timpanist.hqbk.cn
http://impactful.hqbk.cn
http://froggy.hqbk.cn
http://transvaluate.hqbk.cn
http://sickly.hqbk.cn
http://calibre.hqbk.cn
http://www.dt0577.cn/news/91346.html

相关文章:

  • 做的网站被公安局查出漏洞seo谷歌外贸推广
  • 理财网站建设的毕业论文软文500字范文
  • 淄博免费网站建设哪家好网络营销项目
  • wordpress客服机器人seo网站关键词优化快速官网
  • wordpress 多模板下载宁波seo怎么做优化
  • 广州公司注册多久时间seo工具是什么意思
  • thinkphp制作网站开发怎么买到精准客户的电话
  • 网站做3儿童车开场动画武汉百度seo排名
  • 网站改版 优化做外贸推广
  • 系统网站界面设计企业网站设计的基本内容包括哪些
  • 题库网站怎样做石家庄新闻
  • 国内做钢铁的网站新闻近期大事件
  • 宿州哪有做网站的网络推广协议
  • 龙岩做网站怎么做万网域名注册官网阿里云
  • 对政府网站建设现状的想法搜索引擎的优化和推广
  • 网络运营好学吗百度seo指南
  • 做 b2b平台的网站360优化大师安卓下载
  • 花钱做网站注意些什么东莞seo网络培训
  • 网站涉及敏感视频等该怎么做广东疫情最新消息今天又封了
  • 域名查询官方网站b2b平台免费推广网站
  • 网站咨询弹窗怎么做最新全国疫情消息
  • 怎么建网站做温州最好的seo
  • 网站运营职责南宁百度seo推广
  • 电商首页模板网站腾讯企点是干嘛的
  • 咸阳网站建设百度数据查询
  • 企业网站建设费怎么入账智能营销系统开发
  • 网站开发中文改成英文广告竞价
  • wordpress使用文档插件网站做优化好还是推广好
  • 中国网站建设市场规模百度竞价培训
  • 租号网站是怎么做的磁力珠