对于Contacts.Intents.UI类型,方法findViewById(View,int)是未定义的

时间:2015-01-21 09:29:40

标签: android

@Override
    public View getView(int position, View convertView, ViewGroup parent) {
        View layout = convertView;
        if (convertView == null) {
            layout = inflater.inflate(R.layout.complex1, null);
            AphidLog.d("created new view from adapter: %d", position);
        }

        final Travels.Data data = travelData.get(position % travelData.size());

        UI.<TouchImageView> **findViewById**(layout, R.id.photo).setImageBitmap(
                IO.readBitmap(inflater.getContext().getAssets(),
                        data.imageFilename));

        return layout;
    }

findViewById 时出错。 我不知道。帮助我解决。 有显示:

类型findViewById(View, int)

的方法Contacts.Intents.UI未定义

1 个答案:

答案 0 :(得分:0)

而不是finViewById()使用layout.findViewById(),而View将通过View layout上的ID搜索{{1}}。