国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

Android之 日歷單選多選控件

這篇具有很好參考價(jià)值的文章主要介紹了Android之 日歷單選多選控件。希望對(duì)大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問。

一,效果圖

1.1 單選

Android之 日歷單選多選控件

?2.2 多選

Android之 日歷單選多選控件

二 實(shí)現(xiàn)思路

2.1 數(shù)據(jù)來源,利用原生日歷Calendar,獲取從本月開始的往后一年的日期,遍歷月數(shù)添加全部天數(shù)據(jù)

private void initCalendarData() {
        Calendar calendar = Calendar.getInstance();
        year = calendar.get(Calendar.YEAR);
        month = calendar.get(Calendar.MONTH);
        day = calendar.get(Calendar.DAY_OF_MONTH);
        nowDay = day;
        calendar.set(year, month, 1);

        for (int i = 0; i < 12; i++) {
            List<DateEntity> deList = new ArrayList<>();
            MonthEntity monthEntity = new MonthEntity();
            int maxDayOfMonth = calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
            int empty = calendar.get(Calendar.DAY_OF_WEEK);
            empty = empty == 1 ? 6 : empty - 2;
            for (int j = 0; j < empty; j++) {
                DateEntity de = new DateEntity();
                de.setType(1);
                deList.add(de);
            }
            for (int j = 1; j <= maxDayOfMonth; j++) {
                DateEntity de = new DateEntity();
                if (i == 0) {
                    de.setType(j < nowDay ? 4 : 0);
                } else {
                    de.setType(0);
                }

                de.setDate(j);
                if (i == 0 && nowDay == j) {
                    de.setToday(true);
                } else {
                    de.setToday(false);
                }
                de.setParentPos(i);
                String[] result=DatePickerUtils.getLunarDate(year, month + 1, j);
                de.setDesType(result[0]);
                de.setDesc(result[1]);
                deList.add(de);
            }

            year = calendar.get(Calendar.YEAR);
            month = calendar.get(Calendar.MONTH) + 1;
            monthEntity.setTitle(year + "年" + month + "月");
            monthEntity.setYear(year);
            monthEntity.setMonth(month);
            monthEntity.setList(deList);
            monthList.add(monthEntity);

            calendar.add(Calendar.MONTH, 1);
        }
    }

2.2 添加公立,農(nóng)歷,節(jié)氣數(shù)據(jù)。下面只是節(jié)假日的判斷。

 private static String getChinaCalendarMsg(int year, int month, int day) {
        String message = "";
        if (((month) == 1) && day == 1) {
            message = "春節(jié)";
        } else if (((month) == 1) && day == 15) {
            message = "元宵";
        } else if (((month) == 5) && day == 5) {
            message = "端午";
        } else if ((month == 7) && day == 7) {
            message = "七夕";
        } else if (((month) == 8) && day == 15) {
            message = "中秋";
        } else if ((month == 9) && day == 9) {
            message = "重陽";
        } else if ((month == 12) && day == 8) {
            message = "臘八";
        } else {
            if (month == 12) {
                if ((((monthDays(year, month) == 29) && day == 29))
                        || ((((monthDays(year, month) == 30) && day == 30)))) {
                    message = "除夕";
                }
            }
        }
        return message;
    }

2.3 控件,可以用兩層Recycleview,但最好不要這樣做,嵌套體驗(yàn)是非常差的,明顯的卡頓。所以盡量用一個(gè)Recycleview,利用getItemViewType來避免嵌套。

@Override
    public int getItemViewType(int position) {
        if (isEmptyPosition(position)) {
            // 空布局
            return TYPE_EMPTY;
        }
        mTempPosition = position;
        int groupPosition = getGroupPositionForPosition(position);
        int type = judgeType(position);
        if (type == TYPE_HEADER) {
            return getHeaderViewType(groupPosition);
        } else if (type == TYPE_FOOTER) {
            return getFooterViewType(groupPosition);
        } else if (type == TYPE_CHILD) {
            int childPosition = getChildPositionForPosition(groupPosition, position);
            return getChildViewType(groupPosition, childPosition);
        }
        return super.getItemViewType(position);
    }

三, 核心源碼

3.1 項(xiàng)目結(jié)構(gòu)

Android之 日歷單選多選控件

3.2?CalendarSelectDialog.java

public class CalendarSelectDialog extends Dialog {
    private ImageView icClose;
    private RecyclerView rvCalendar;
    private TextView tvSure;


    private Activity context;

    private CalendarGroupedListAdapter groupedListAdapter;
    private List<MonthEntity> monthList = new ArrayList<>();

    private int year, month, day;
    private int nowDay;
    private int lastDateSelect = -1, lastMonthSelect = -1;

    public interface OnViewClickLiatener {
        void sureClick(String selectTime);

        void cancelClick();
    }

    public OnViewClickLiatener onViewClickLiatener;

    public void setOnViewClickLiatener(OnViewClickLiatener onViewClickLiatener) {
        this.onViewClickLiatener = onViewClickLiatener;
    }


    public CalendarSelectDialog(Activity context) {
        super(context, R.style.custom_dialog2);
        this.context = context;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dialog_caledar_select);
        setCanceledOnTouchOutside(true);
        WindowManager.LayoutParams params = getWindow().getAttributes();
        params.width = ScreenUtils.getScreenWidth(context);
        params.height = (int) (ScreenUtils.getTotalScreenHeight(context)*0.85f);
        getWindow().setGravity(Gravity.BOTTOM);
        getWindow().setAttributes(params);
        getWindow().setBackgroundDrawableResource(R.color.transparent);
        getWindow().setWindowAnimations(R.style.pop_animation_bottom);
        initView();
        setData();

    }

    public void initView() {
        icClose = (ImageView) findViewById(R.id.ic_close);
        rvCalendar = (RecyclerView) findViewById(R.id.rv_calendar);
        tvSure = (TextView) findViewById(R.id.tv_sure);

    }

    public void setData() {
        icClose.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                dismiss();
                if (onViewClickLiatener != null) {
                    onViewClickLiatener.cancelClick();
                }
            }
        });
        tvSure.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if(lastMonthSelect<0){
                    ToastHelp.showToast("請選擇日期");
                    return;
                }
                dismiss();
                MonthEntity monthEntity=monthList.get(lastMonthSelect);
                DateEntity dateEntity=monthEntity.getList().get(lastDateSelect);
                int year=monthEntity.getYear();
                int month=monthEntity.getMonth();
                int date=dateEntity.getDate();

                String monthString;
                if(month<10){
                    monthString="0"+month;
                }else {
                    monthString=String.valueOf(month);
                }

                String dataString;
                if(date<10){
                    dataString="0"+date;
                }else {
                    dataString=String.valueOf(date);
                }

                String selectTime=year+"-"+monthString+"-"+dataString;
                if (onViewClickLiatener != null) {
                    onViewClickLiatener.sureClick(selectTime);
                }
            }
        });
        CalendarUtils.init(context);
        initCalendarData();
        initCalendarRv();
    }



    @Override
    public void dismiss() {
        if (context == null || ((Activity) context).isDestroyed() || ((Activity) context).isFinishing()) {
            return;
        }
        super.dismiss();
    }

    @Override
    public void show() {
        if (context == null || ((Activity) context).isDestroyed() || ((Activity) context).isFinishing()) {
            return;
        }
        super.show();
    }


    private void initCalendarData() {
        Calendar calendar = Calendar.getInstance();
        year = calendar.get(Calendar.YEAR);
        month = calendar.get(Calendar.MONTH);
        day = calendar.get(Calendar.DAY_OF_MONTH);
        nowDay = day;
        calendar.set(year, month, 1);

        for (int i = 0; i < 12; i++) {
            List<DateEntity> deList = new ArrayList<>();
            MonthEntity monthEntity = new MonthEntity();
            int maxDayOfMonth = calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
            int empty = calendar.get(Calendar.DAY_OF_WEEK);
            empty = empty == 1 ? 6 : empty - 2;
            for (int j = 0; j < empty; j++) {
                DateEntity de = new DateEntity();
                de.setType(1);
                deList.add(de);
            }
            for (int j = 1; j <= maxDayOfMonth; j++) {
                DateEntity de = new DateEntity();
                if (i == 0) {
                    de.setType(j < nowDay ? 4 : 0);
                } else {
                    de.setType(0);
                }

                de.setDate(j);
                if (i == 0 && nowDay == j) {
                    de.setToday(true);
                } else {
                    de.setToday(false);
                }
                de.setParentPos(i);
                String[] result=DatePickerUtils.getLunarDate(year, month + 1, j);
                de.setDesType(result[0]);
                de.setDesc(result[1]);
                deList.add(de);
            }

            year = calendar.get(Calendar.YEAR);
            month = calendar.get(Calendar.MONTH) + 1;
            monthEntity.setTitle(year + "年" + month + "月");
            monthEntity.setYear(year);
            monthEntity.setMonth(month);
            monthEntity.setList(deList);
            monthList.add(monthEntity);

            calendar.add(Calendar.MONTH, 1);
        }

    }

    private void initCalendarRv() {
        groupedListAdapter =new CalendarGroupedListAdapter(context,monthList);
        GroupedGridLayoutManager gridLayoutManager = new GroupedGridLayoutManager(context, 7, groupedListAdapter);
        rvCalendar.setLayoutManager(gridLayoutManager);
        rvCalendar.getItemAnimator().setChangeDuration(0);
        rvCalendar.setAdapter(groupedListAdapter);
        groupedListAdapter.setOnItemClickListener(new CalendarGroupedListAdapter.OnItemClickListener() {
            @Override
            public void itemClick(int groupPosition, int childPosition) {
                //setRangeClick(groupPosition,childPosition);
                setSingleClick(groupPosition,childPosition);
            }
        });
    }

    private void getViews() {
        rvCalendar = (RecyclerView) findViewById(R.id.rv_calendar);
    }

    /**
     *
     * @param groupPosition
     * @param childPosition
     */
    private void setSingleClick(int groupPosition, int childPosition){
        if (groupPosition == lastMonthSelect && childPosition == lastDateSelect) {
            return;
        }

        monthList.get(groupPosition).getList().get(childPosition).setType(8);

        groupedListAdapter.notifyChildChanged(groupPosition, childPosition);
        if (lastDateSelect != -1) {
            monthList.get(lastMonthSelect).getList().get(lastDateSelect).setType(0);
            groupedListAdapter.notifyChildChanged(lastMonthSelect, lastDateSelect);
        }
        lastMonthSelect = groupPosition;
        lastDateSelect = childPosition;
    }

    /**
     * 范圍選擇
     */
    private boolean selectComplete;
    private List<Integer> selectMonth = new ArrayList<>();
    private List<Integer> selectDate = new ArrayList<>();
    private void setRangeClick(int parentPos, int pos){
        if (parentPos != lastMonthSelect || pos != lastDateSelect) {

            //1、第二次選擇;2、選擇的月份相等日期比之前選擇的大或者選擇的月份比之前的大;3、選擇未完成
            boolean haveMiddle = lastMonthSelect != -1 && ((lastMonthSelect == parentPos && pos > lastDateSelect) || (parentPos > lastMonthSelect))
                    && !selectComplete;
            if (haveMiddle) {
                monthList.get(parentPos).getList().get(pos).setType(6);
                selectDate.add(1);
                monthList.get(lastMonthSelect).getList().get(lastDateSelect).setType(7);
                selectDate.add(1);

                int monthLen = parentPos - lastMonthSelect;
                List<DateEntity> list;
                int dateLen;
                if (monthLen == 0) {
                    dateLen = pos - lastDateSelect;
                    for (int i = 1; i < dateLen; i++) {
                        monthList.get(parentPos).getList().get(i + lastDateSelect).setType(5);
                        selectDate.add(1);
                    }
                    groupedListAdapter.notifyGroupChanged(lastMonthSelect);
                    //選擇了這個(gè)月
                    selectMonth.add(parentPos);
                } else {
                    //第一個(gè)月
                    int lastMonthSize = monthList.get(lastMonthSelect).getList().size();
                    dateLen = lastMonthSize - lastDateSelect;
                    for (int i = 1; i < dateLen; i++) {
                        monthList.get(lastMonthSelect).getList().get(i + lastDateSelect).setType(5);
                        selectDate.add(1);
                    }
                    groupedListAdapter.notifyGroupChanged(lastMonthSelect);
                    //選擇了這個(gè)月
                    selectMonth.add(lastMonthSelect);

                    //中間月份
                    int month;
                    int middleMonthLen = parentPos - lastMonthSelect;
                    for (int i = 1; i < middleMonthLen; i++) {
                        month = lastMonthSelect + i;
                        list = monthList.get(month).getList();
                        dateLen = list.size();
                        for (int j = 0; j < dateLen; j++) {
                            if (list.get(j).getType() != 1) {
                                list.get(j).setType(5);
                                selectDate.add(1);
                            }
                        }
                        groupedListAdapter.notifyGroupChanged(month);
                        //選擇了這個(gè)月
                        selectMonth.add(month);
                    }

                    //最后那個(gè)月
                    dateLen = pos;
                    for (int i = 0; i < dateLen; i++) {
                        DateEntity de = monthList.get(parentPos).getList().get(i);
                        if (de.getType() != 1) {
                            de.setType(5);
                            selectDate.add(1);
                        }
                    }
                    groupedListAdapter.notifyGroupChanged(parentPos);
                    //選擇了這個(gè)月
                    selectMonth.add(parentPos);
                }
                Log.d("mita", "選擇的天數(shù):" + selectDate.size());
                selectComplete = true;
                lastMonthSelect = -1;
                lastDateSelect = -1;
            } else {
                selectDate.clear();

                //清除已選
                if (selectComplete) {
                    List<DateEntity> list;
                    DateEntity de;
                    int len = selectMonth.size();
                    for (int i = 0; i < len; i++) {
                        list = monthList.get(selectMonth.get(i)).getList();
                        int size = list.size();
                        for (int j = 0; j < size; j++) {
                            de = list.get(j);
                            if (de.getType() == 5 || de.getType() == 6 || de.getType() == 7) {
                                de.setType(0);
                            }
                        }
                        groupedListAdapter.notifyGroupChanged(selectMonth.get(i));
                    }
                    selectMonth.clear();
                }

                monthList.get(parentPos).getList().get(pos).setType(3);
                groupedListAdapter.notifyGroupChanged(parentPos);
                if (lastDateSelect != -1) {
                    monthList.get(lastMonthSelect).getList().get(lastDateSelect).setType(0);
                    groupedListAdapter.notifyGroupChanged(lastMonthSelect);
                }
                lastMonthSelect = parentPos;
                lastDateSelect = pos;
                selectComplete = false;
            }
        }
    }
}

3.2?CalendarGroupedListAdapter.java

public class CalendarGroupedListAdapter extends GroupedRecyclerViewAdapter {


    private List<MonthEntity> groupList;
    private Context context;

    public CalendarGroupedListAdapter(Context context, List<MonthEntity> groupList) {
        super(context);
        this.context = context;
        this.groupList = groupList;
    }

    @Override
    public int getGroupCount() {
        return groupList.size();
    }

    @Override
    public int getChildrenCount(int groupPosition) {
        return groupList.get(groupPosition).getList().size();
    }

    @Override
    public boolean hasHeader(int groupPosition) {
        return true;
    }

    @Override
    public boolean hasFooter(int groupPosition) {
        return false;
    }

    @Override
    public int getHeaderLayout(int viewType) {
        return R.layout.item_calendar;
    }

    @Override
    public int getFooterLayout(int viewType) {
        return 0;
    }

    @Override
    public int getChildLayout(int viewType) {
        return R.layout.item_date;
    }

    @Override
    public void onBindHeaderViewHolder(BaseViewHolder holder, int groupPosition) {
        MonthEntity monthEntity = groupList.get(groupPosition);
        holder.setText(R.id.tv_cal_title, monthEntity.getTitle());

    }

    @Override
    public void onBindFooterViewHolder(BaseViewHolder holder, int groupPosition) {

    }

    @Override
    public void onBindChildViewHolder(BaseViewHolder holder, final int groupPosition, final int childPosition) {
        DateEntity dateEntity = groupList.get(groupPosition).getList().get(childPosition);


        LinearLayout llDate = holder.get(R.id.ll_date);
        TextView mTvDate = holder.get(R.id.tv_date);
        TextView mTvDesc = holder.get(R.id.tv_desc);
        TextView mTvToday = holder.get(R.id.tv_today);
        mTvToday.setText("今日");

        int date = dateEntity.getDate();
        int type = dateEntity.getType();
        boolean isToday = dateEntity.isToday();
        if (type == 1) {//留白
            mTvToday.setVisibility(isToday ? View.VISIBLE : View.INVISIBLE);
            mTvToday.setTextColor(Color.TRANSPARENT);
            mTvDate.setText("");
            mTvDesc.setText("");
            mTvDate.setTextColor(Color.TRANSPARENT);
            mTvDesc.setTextColor(Color.TRANSPARENT);
            llDate.setBackgroundColor(Color.TRANSPARENT);
            llDate.setEnabled(false);
        } else if (type == 0) {//日常
            mTvToday.setVisibility(isToday ? View.VISIBLE : View.INVISIBLE);
            mTvDate.setText(String.valueOf(dateEntity.getDate()));
            mTvDesc.setText(dateEntity.getDesc());
            mTvToday.setTextColor(ContextCompat.getColor(context, R.color.color_red));
            mTvDate.setTextColor(ContextCompat.getColor(context, R.color.color_333333));
            mTvDesc.setTextColor(TextUtils.isEmpty(dateEntity.getDesType()) ? ContextCompat.getColor(context, R.color.color_333333) : ContextCompat.getColor(context, R.color.color_red));
            llDate.setBackgroundColor(Color.TRANSPARENT);
            llDate.setEnabled(true);
        } else if (type == 3) {//日常選中
            mTvToday.setVisibility(isToday ? View.VISIBLE : View.INVISIBLE);
            mTvDate.setText(String.valueOf(dateEntity.getDate()));
            mTvDesc.setText(dateEntity.getDesc());
            mTvToday.setTextColor(ContextCompat.getColor(context, R.color.white));
            mTvDate.setTextColor(ContextCompat.getColor(context, R.color.white));
            mTvDesc.setTextColor(ContextCompat.getColor(context, R.color.white));
            llDate.setBackgroundResource(R.drawable.state_selected);
            llDate.setClickable(true);
        } else if (type == 4) {//今天之前的日期
            mTvToday.setVisibility(isToday ? View.VISIBLE : View.INVISIBLE);
            mTvDate.setText(String.valueOf(dateEntity.getDate()));
            mTvDesc.setText(dateEntity.getDesc());
            mTvToday.setTextColor(ContextCompat.getColor(context, R.color.color_cccccc));
            mTvDate.setTextColor(ContextCompat.getColor(context, R.color.color_cccccc));
            mTvDesc.setTextColor(ContextCompat.getColor(context, R.color.color_cccccc));
            llDate.setBackgroundColor(Color.TRANSPARENT);
            llDate.setEnabled(false);
        } else if (type == 5) {//中間
            mTvToday.setVisibility(isToday ? View.VISIBLE : View.INVISIBLE);
            mTvDate.setText(String.valueOf(dateEntity.getDate()));
            mTvDesc.setText(dateEntity.getDesc());
            mTvToday.setTextColor(ContextCompat.getColor(context, R.color.white));
            mTvDate.setTextColor(ContextCompat.getColor(context, R.color.white));
            mTvDesc.setTextColor(ContextCompat.getColor(context, R.color.white));
            llDate.setBackgroundResource(R.drawable.state_middle_range);
            llDate.setEnabled(true);
        } else if (type == 6) {//終點(diǎn)
            mTvToday.setVisibility(isToday ? View.VISIBLE : View.INVISIBLE);
            mTvDate.setText(String.valueOf(dateEntity.getDate()));
            mTvDesc.setText("結(jié)束");
            mTvToday.setTextColor(ContextCompat.getColor(context, R.color.white));
            mTvDate.setTextColor(ContextCompat.getColor(context, R.color.white));
            mTvDesc.setTextColor(ContextCompat.getColor(context, R.color.white));
            llDate.setBackgroundResource(R.drawable.state_end_range);
            llDate.setEnabled(true);
        } else if (type == 7) {//起點(diǎn)
            mTvToday.setVisibility(isToday ? View.VISIBLE : View.INVISIBLE);
            mTvDate.setText(String.valueOf(dateEntity.getDate()));
            mTvDesc.setText("開始");
            mTvToday.setTextColor(ContextCompat.getColor(context, R.color.white));
            mTvDate.setTextColor(ContextCompat.getColor(context, R.color.white));
            mTvDesc.setTextColor(ContextCompat.getColor(context, R.color.white));
            llDate.setBackgroundResource(R.drawable.state_first_range);
            llDate.setEnabled(true);
        } else if (type == 8) {//單選
            mTvToday.setVisibility(isToday ? View.VISIBLE : View.INVISIBLE);
            mTvDate.setText(String.valueOf(dateEntity.getDate()));
            mTvDesc.setText(dateEntity.getDesc());
            mTvToday.setTextColor(ContextCompat.getColor(context, R.color.white));
            mTvDate.setTextColor(ContextCompat.getColor(context, R.color.white));
            mTvDesc.setTextColor(ContextCompat.getColor(context, R.color.white));
            llDate.setBackgroundResource(R.drawable.state_selected);
            llDate.setEnabled(true);
        }

        llDate.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (onItemClickListener != null) {
                    onItemClickListener.itemClick(groupPosition, childPosition);
                }
            }
        });
    }

    public interface OnItemClickListener {
        void itemClick(int groupPosition, int childPosition);
    }

    public OnItemClickListener onItemClickListener;

    public void setOnItemClickListener(OnItemClickListener onItemClickListener) {
        this.onItemClickListener = onItemClickListener;
    }
}

四,注意

4.1 由于左右留白,父控件Recycleview做了外邊距margin,會(huì)導(dǎo)致子控件左右也有邊距。但UI要求是無邊距的,這個(gè)時(shí)候就需要特殊處理控件。

<androidx.recyclerview.widget.RecyclerView
? ? android:id="@+id/rv_calendar"
? ? android:layout_width="match_parent"
? ? android:layout_height="match_parent"
? ? android:layout_marginLeft="12dp"
? ? android:layout_marginRight="12dp"
? ? android:overScrollMode="never"/>

Android之 日歷單選多選控件?

4.2 方法,可以用裁剪屬性clipChildren,來控制他的子控件是否要在他應(yīng)有的邊界內(nèi)進(jìn)行繪制

android:clipChildren=“false” 就是不限制他子控件在其邊界內(nèi)進(jìn)行繪制
android:clipChildren=“true” 限制他子控件在其邊界內(nèi)進(jìn)行繪制

?4.3?clipChildren需要特別注意,加在RecyclerView父控件是沒用的,只能加載RecyclerView的父控件,即需要需要裁剪的view的爺輩控件。如下:添加屬性android:clipChildren="false"文章來源地址http://www.zghlxwxcb.cn/news/detail-495229.html

  <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        android:clipChildren="false">

        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/rv_calendar"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_marginLeft="12dp"
            android:layout_marginRight="12dp"
            android:overScrollMode="never"/>

    </FrameLayout>

到了這里,關(guān)于Android之 日歷單選多選控件的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場。本站僅提供信息存儲(chǔ)空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • element中Table表格控件單選、多選功能進(jìn)一步優(yōu)化
  • 【Android從零單排系列十一】《Android視圖控件——日歷、日期、時(shí)間選擇控件》

    【Android從零單排系列十一】《Android視圖控件——日歷、日期、時(shí)間選擇控件》

    目錄 一.日歷、日期、時(shí)間組件基本介紹 二.幾種常見的控件類型 1.CalendarView –日歷控件 2. DatePicker –日期選擇控件 3.TimePicker –時(shí)間選擇控件 4.Chronometer—計(jì)時(shí)器控件 三.DEMO 小伙伴們,在上文中我們介紹了Android視圖控件ImageView控件,本文我們繼續(xù)盤點(diǎn),介紹一下視圖控件的

    2023年04月09日
    瀏覽(23)
  • 【網(wǎng)絡(luò)安全】單選/多選/判斷/填空題

    一、選擇題(每小題 2分,共30分) 1.計(jì)算機(jī)網(wǎng)絡(luò)的安全是指( C ) A.網(wǎng)絡(luò)中設(shè)備設(shè)置環(huán)境的安全 B.網(wǎng)絡(luò)使用者的安全 C.網(wǎng)絡(luò)中信息的安全 D.網(wǎng)絡(luò)的財(cái)產(chǎn)安全 2.信息風(fēng)險(xiǎn)主要是指( D ) A.信息存儲(chǔ)安全 B.信息傳輸安全 C.信息訪問安全 D.以上都正確 3.以下( D )

    2023年04月20日
    瀏覽(17)
  • 微信小程序——實(shí)現(xiàn)單選、多選

    微信小程序——實(shí)現(xiàn)單選、多選

    單選使用radio-group標(biāo)簽包裹radio標(biāo)簽 多選使用checkbox-group 標(biāo)簽包裹c(diǎn)heckbox標(biāo)簽 ?單選和多選的wxml代碼 以下是wxss代碼

    2024年02月06日
    瀏覽(28)
  • Element UI 表格單選、多選情景

    Element UI 表格單選、多選情景

    最近在使用Element UI編寫簡單前端頁面時(shí)會(huì)遇到需要對(duì)表格進(jìn)行選擇操作的場景。在網(wǎng)絡(luò)上面查詢資料時(shí)發(fā)現(xiàn)實(shí)現(xiàn)方式多的看花眼,索性自己總結(jié)一個(gè)。 話不多說,搬代碼來看看~ 單選: 從單選這一塊需求來看,至少滿足下面兩點(diǎn)才能算是完成: 全選框的點(diǎn)擊只能取消其他

    2024年02月11日
    瀏覽(17)
  • 微信小程序如何自定義單選和多選

    微信小程序如何自定義單選和多選

    實(shí)現(xiàn)效果:點(diǎn)擊顯示單選狀態(tài),每次僅能點(diǎn)擊一個(gè)元素。 實(shí)現(xiàn)方式: wxml:? ?item_list是單選的元素,class定義了選中和未選中的顯示形式,changeColor更新點(diǎn)擊元素。 ?.wxss? 定義選中和未選中的顯示樣式。 .js?

    2024年01月25日
    瀏覽(24)
  • element ui 多選框內(nèi)嵌套單選框

    element ui 多選框內(nèi)嵌套單選框

    多選框內(nèi)嵌套單選框

    2024年02月10日
    瀏覽(21)
  • vue tree禁用和多選變?yōu)閱芜x

    禁用的話和后臺(tái)協(xié)調(diào)一下,參數(shù)中多返回一個(gè)disabled 在tree結(jié)構(gòu)中加入一個(gè)方法 方法 nodes.id要與tree中的node-key對(duì)應(yīng),且必須是唯一不能重復(fù)

    2024年02月12日
    瀏覽(18)
  • el-table 多選框改成單選框(el-table單選功能)

    今天,寫項(xiàng)目時(shí),有一個(gè)table作為篩選的載體,需要選中table里面的一條數(shù)據(jù),我想了一下,用table里面的selection功能,實(shí)現(xiàn)單選功能。

    2024年02月16日
    瀏覽(25)
  • el-select控制單選還是多選

    el-select控制單選還是多選

    2024年02月13日
    瀏覽(15)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包