0

ViewPagerFragmentsを使用しています。はデフォルト設定で動作していますが、カスタム(フォント サイズ + 画像)ListViewを使用するにはどうすればよいですか?ListView

これまでの私のコード:

public class Page2Fragment extends Fragment {
    Button btnWrite;

    public String ptext="..PAGE 2..";
    private String arry[] = { "Tofeeq", "Ahmad", "Fragment", "Example",
        "Tofeeq", "Ahmad", "Fragment", "Example" };

    public View onCreateView(LayoutInflater inflater,ViewGroup container,Bundle savedInstanceState) {
    // fragment not when container null
    if (container == null) {
     return null;
    }      

    // inflate view from layout
    View view = (LinearLayout)inflater.inflate(R.layout.page2,container,false);
    // update text
    TextView tv = (TextView) view.findViewById(R.id.tvText2);
    tv.setText(ptext);      

    ListView listView = (ListView) view.findViewById(R.id.listView1);       
    ArrayAdapter<String> array = new ArrayAdapter<String>(getActivity(), android.R.layout.simple_list_item_1);  

    for (String str : arry)
        array.add(str);     
    listView.setAdapter(array);   
      return view;      
   }

   // set text helper function
    public void setText(String item) {
    TextView view = (TextView) getView().findViewById(R.id.tvText2);
    view.setText(item);
   }   
}
4

1 に答える 1