5.29
今天进行了最后的测试,达标
学会了安卓按钮颜色的修改
1 <android.widget.Button 2 android:id="@+id/loginButton" 3 android:layout_width="wrap_content" 4 android:layout_height="wrap_content" 5 android:text="Login" 6 android:background="@color/blue" 7 android:layout_marginTop="16dp"/>
第一行加上android.weight. 就行
今天代码量:500
完成了测试中的新增数据,条件查询数据,使用到了adapter适配器进行列表的展示
适配器的使用见:D:\AndroidStudy\Meeting目录
问题和困难:
适配器的使用不太熟练,现在只会套用以前的模板进行写,还需要再进一步熟悉
1 package com.lian.meeting.Adapter;
2
3 import android.content.Context;
4 import android.view.LayoutInflater;
5 import android.view.View;
6 import android.view.ViewGroup;
7 import android.widget.ArrayAdapter;
8 import android.widget.TextView;
9
10 import com.lian.meeting.bean.Meetroom;
11
12 import java.util.List;
13
14 public class MeetingAdapter extends ArrayAdapter<Meetroom> {
15
16 public MeetingAdapter(Context context, List<Meetroom> policies) {
17 super(context, 0, policies);
18 }
19
20 @Override
21 public View getView(int position, View convertView, ViewGroup parent) {
22 Meetroom meetroom = getItem(position);
23
24 if (convertView == null) {
25 convertView = LayoutInflater.from(getContext()).inflate(android.R.layout.simple_list_item_1, parent, false);
26 }
27
28 TextView titleTextView = convertView.findViewById(android.R.id.text1);
29 titleTextView.setText(meetroom.getMeetroomname());
30
31 return convertView;
32 }
33 }

浙公网安备 33010602011771号