inflater = LayoutInflater.from(context);
map = new HashMap<Integer, Boolean>();
for(int i=0;i<citys.length;i++){
map.put(i, false);
}
}
public int getCount() {
// TODO Auto-generated method stub
return citys.length;
}
public Object getItem(int position) {
// TODO Auto-generated method stub
return null;
}
public long getItemId(int position) {
// TODO Auto-generated method stub
return position;
}
public View getView(int position, View view, ViewGroup parent) {
// TODO Auto-generated method stub
if(view == null){
view = inflater.inflate(R.layout.bank_item, null);
}
TextView textView = (TextView) view.findViewById(R.id.list_text);
RadioButton radioButton = (RadioButton) view.findViewById(R.id.radiobutton);
radioButton.setChecked(map.get(position));
textView.setText(citys[position]);
return view;
}
}
bank_grid.xml
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android=“http://schemas.android.com/apk/res/android”
android:layout_width=“fill_parent”
android:layout_height=“fill_parent”
android:orientation=“vertical”
android:padding=“20dp”
android:background=“#ffffff”
android:id=“@+id/grid_layout”>
<GridView
android:id=“@+id/grid”
android:layout_width=“fill_parent”
android:layout_height=“fill_parent”
android:verticalSpacing=“20px”
android:horizontalSpacing=“10px”
android:numColumns=“4”
android:scrollbars=“vertical”
android:layout_margin=“10dp”/>
bank_item.xml
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android=“http://schemas.android.com/apk/res/android”
android:layout_width=“fill_parent”
android:layout_height=“fill_parent”
android:background=“#ffffff”
<RadioButton
android:id=“@+id/radiobutton”
android:layout_width=“wrap_content”
android:layout_height=“wrap_content”
android:layout_marginRight=“15dp”
android:focusable=“false”
android:clickable=“false”
android:focusableInTouchMode=“false”
/>
<TextView
android:id=“@+id/list_text”
android:layout_width=“wrap_content”
最后
由于文章篇幅原因,我只把面试题列了出来,详细的答案,我整理成了一份PDF文档,这份文档还包括了还有 高级架构技术进阶脑图、Android开发面试专题资料,高级进阶架构资料 ,帮助大家学习提升进阶,也节省大家在网上搜索资料的时间来学习。
需要的朋友可以私信我【答案】或者点击这里免费领取
自我介绍一下,小编13年上海交大毕业,曾经在小公司待过,也去过华为、OPPO等大厂,18年进入阿里一直到现在。
深知大多数初中级安卓工程师,想要提升技能,往往是自己摸索成长,但自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!
因此收集整理了一份《2024年最新Android移动开发全套学习资料》送给大家,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友,同时减轻大家的负担。
由于文件比较大,这里只是将部分目录截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频
如果你觉得这些内容对你有帮助,可以添加下面V无偿领取!(备注Android)
外链图片转存中…(img-H3v38jkn-1710960948714)]
由于文件比较大,这里只是将部分目录截图出来,每个节点里面都包含大厂面经、学习笔记、源码讲义、实战项目、讲解视频
如果你觉得这些内容对你有帮助,可以添加下面V无偿领取!(备注Android)
[外链图片转存中…(img-I13Yl6V3-1710960948714)]