如何在itext android中增加列表项目符号大小?

问题描述:

我在我的android应用程序里面使用了itext pdf生成器。我在哪里使用有序列表和无序列表。我无法增加子弹和Order的文本大小。我使用下面的代码增加了列表项大小。如何在itext android中增加列表项目符号大小?

List list = new List(List.ORDERED); 
    list.setPostSymbol(") "); 
    //Ingredients Entry 
    for (String ingredient : ingredients.split("#")) { 

     font = new Font(Font.FontFamily.HELVETICA, txtSize_content, Font.NORMAL, BaseColor.BLACK); 
     chunk = new Chunk(ingredient, font); 
     //To set alignment to chunk 
     phrase = new Phrase(); 
     phrase.add(chunk); 
     para = new Paragraph(); 
     para.add(phrase); 
     para.setSpacingBefore(txtSize_content); 
     para.setAlignment(Element.ALIGN_LEFT); 
     //end To set alignment to chunk 
     //Add List Item to List 
     ListItem item = new ListItem(para); 
     item.setAlignment(Element.ALIGN_JUSTIFIED); 
     list.add(item); 

    } 
    document.add(list); 

你正在搞这个大块和短语的组合。试试这个:

list.add(new ListItem(ingredient, font)) 

或创建这样的段落:

new Paragraph(ingredient, font) 

在无序列表与字体第一个列表项似乎将所有列表符号的大小。 有序列表采用每个ListItem(或段落)的字体来呈现数字。 (v4.1.6)

+0

完美的解决方案。 – nidhi