Android自定义控件类在XML中引入找不到类

icicle529 2016-03-03 02:31:36
PROBLEM:
Rendering Problems The following classes could not be found:
- com.lww.leefamily.leefamily.Controls.TitleLayout (Change to android.widget.TableLayout, Fix Build Path, Create Class)
Tip: Try to build the project.

我已经创建了类,在xml中输入<com可以直接找到这个类,但是还是报错,CLEAN过了,求大神指点。

以下是代码:
class:
package com.lww.leefamily.leefamily.Controls;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.LinearLayout;

import com.lww.leefamily.leefamily.R;

/**
* Created by Administrator on 2016/3/3 0003.
*/
public class TitleLayout extends LinearLayout {

public TitleLayout(Context context,AttributeSet attrs){
super(context,attrs);
LayoutInflater.from(context).inflate(R.layout.title,this);
}
}

XML

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#d8e0e8"
android:orientation="vertical">

<ListView
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
></ListView>
<com.lww.leefamily.leefamily.Controls.TitleLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
</com.lww.leefamily.leefamily.Controls.TitleLayout>
</LinearLayout>
...全文
1338 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
qq_18945757 2018-12-04
  • 打赏
  • 举报
回复
最后根据报错提示栏下的Tips里的第一个,点了一下build,就好了!!!
assky124 2016-05-31
  • 打赏
  • 举报
回复
编译下试试~~~
baidu_31784755 2016-05-30
  • 打赏
  • 举报
回复
我也想知道啊

80,350

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 Android
androidandroid-studioandroidx 技术论坛(原bbs)
社区管理员
  • Android
  • yechaoa
  • 失落夏天
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧