0

フラグメントに独自のグラフィックを追加したい。たとえば、フラグメントに円を追加することは可能ですか? 私はこのコードを持っています:

public static class DummySectionFragment extends Fragment  {
    /**
     * The fragment argument representing the section number for this
     * fragment.
     */
    public static final String ARG_SECTION_NUMBER = "section_number";
    public static final String ARG_OBJECT = "object";
    public static final String ARG_DATA = "data";


    public DummySectionFragment() {
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState) {
        Bundle args = getArguments();
        int position = args.getInt(ARG_OBJECT);
        String data=args.getString(ARG_DATA);
        int tabLayout = 0;
        switch (position) {
        case 0:
        tabLayout = R.layout.fragment_company_products;
        break;
        case 1:
        tabLayout = R.layout.fragment_main_dummy;
        break;
        case 2:
        tabLayout = R.layout.fragment_main_dummy;
        break;
        case 3:
            tabLayout = R.layout.fragment_main_dummy;
        break;
        }

        View rootView = inflater.inflate(tabLayout, container, false);

        TextView dummyTextView = (TextView) rootView.findViewById(R.id.section_label);

        //dummyTextView.setText(args.getInt(ARG_OBJECT)+"\n"+data+"asd");
        return rootView;
    }


}

各フラグメントでグラフィックを変更したいので、これを尋ねました。これらのフラグメントの一部では、円、円弧、または長方形などの 2D グラフィックを追加する必要があります。これは可能ですか?前もって感謝します

4

1 に答える 1