当我动态地将视图添加到视图中时,会出现这种现象

时间:2016-04-16 03:50:16

标签: android dynamic view android-layout-weight

enter image description here    当我动态地向LinearLayout添加视图时,它出现了..

exp

enter image description here如图所示听到。

NoticeTextViewGroup扩展了LinearLayout,setNoticeGroup是addview方法......

Here is the picture , In the views at the bottom of the display is not complete ...

NoticeTextView还扩展了LinearLayout,

    public void setNoticeGroup(List<String> notices) {
        noticeGroup.removeAllViews();
        for (int i = 0; i < notices.size(); i++) {
            NoticeTextView not = new NoticeTextView(getContext());
            not.setItemTextColor(mTextColor);
            not.setItemTNumColor(mNumColor);
            String symbol = mItemStyle == None ? " " : mItemStyle == Dot ? getResources().getString(R.string.symbol_Dot) + " " : (i + 1) + ".";
            not.setString(symbol);
            not.setText(notices.get(i));
            noticeGroup.addView(not);
        }
        noticeGroup.requestLayout();
    }

0 个答案:

没有答案