首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
您找到你想要的搜索结果了吗?
是的
没有找到

android-popwindow显示位置不对

private void showAllPopWindow() { cityId = “0”; final View popupView = mInflater.inflate(R.layout.activity_recruit_all, null); View other_view= popupView.findViewById(R.id.other_view); RecyclerView recyclerView = (RecyclerView) popupView.findViewById(R.id.recyclerView); recyclerView.setLayoutManager(new LinearLayoutManager(this)); final RecyclerView.Adapter adapter = new CommonAdapter(this, R.layout.activity_recruit_all_item, mCityData) { @Override protected void convert(ViewHolder holder, RecruitCityEntity entity, final int position) { holder.setText(R.id.text, entity.getCityName()); if (mCityData.get(position).isCheck()) { holder.setTextColor(R.id.text, ContextCompat.getColor(RecruitActivity.this, R.color.theme_gold)); } else { holder.setTextColor(R.id.text, ContextCompat.getColor(RecruitActivity.this, R.color.black)); } holder.setOnClickListener(R.id.text, new View.OnClickListener() { @Override public void onClick(View view) { cityId = mCityData.get(position).getId(); for (int i=0;i<mCityData.size();i++) mCityData.get(i).setCheck(false); mCityData.get(position).setCheck(true); notifyDataSetChanged(); if (window!=null) window.dismiss(); mRefreshLayout.beginRefreshing(); } }); } }; recyclerView.setAdapter(adapter);

02
领券