第一行代码 3.4.2 创建自定义控件 章节中初上手出项的下载完成后闪退问题和自定义控件无反应问题
2017-12-11 18:36
295 查看
关于出项下载后闪退并且打开app时也闪退的问题,主要是xml文件出错,一般情况按照书中的流程title.xml文件是没有错误的,主要原因在于 activity_main.xm了文件中,直接说代码
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
/*************************************************************
这一部分是自动生产成的删去的话可能会闪退(我是这样)
***************************************************************/
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.example.appof1.MainActivity" >
/***********************************************************************
这个声明一定要在调用之前声明,否则无效,按键无效的主要原因
**************************************************************************/
<include layout="@layout/title"/>
/********************************************************************************************************************************
包名一定要写对,书上原文是com.example.uicustomviews.TitleLayout我这里创建的时候是appof1这个写错也也会闪退
************************************************************************************************************************************/
<com.example.appof1.TitleLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
></com.example.appof1.TitleLayout>
PS.我是新手,如有错误希望大佬指出,非常感谢
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
/*************************************************************
这一部分是自动生产成的删去的话可能会闪退(我是这样)
***************************************************************/
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.example.appof1.MainActivity" >
/***********************************************************************
这个声明一定要在调用之前声明,否则无效,按键无效的主要原因
**************************************************************************/
<include layout="@layout/title"/>
/********************************************************************************************************************************
包名一定要写对,书上原文是com.example.uicustomviews.TitleLayout我这里创建的时候是appof1这个写错也也会闪退
************************************************************************************************************************************/
<com.example.appof1.TitleLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
></com.example.appof1.TitleLayout>
PS.我是新手,如有错误希望大佬指出,非常感谢
相关文章推荐
- Asp.net 2.0 自定义控件开发[创建自定义右键PopupMenu控件][示例代码下载]
- Asp.net 2.0 自定义控件开发[创建自定义右键PopupMenu控件][示例代码下载]
- Asp.net 2.0 自定义控件开发[创建自定义HeaderRow的GridView控件][示例代码下载]
- Asp.net 2.0 自定义控件开发[创建自定义HeaderRow的GridView控件][示例代码下载]
- Asp.net 2.0 自定义控件开发[创建自定义右键PopupMenu控件][示例代码下载]
- 自定义控件——第一行代码3.4.2
- Asp.net 2.0 自定义控件开发[创建自定义右键PopupMenu控件][示例代码下载]
- Asp.net 2.0 自定义控件开发[创建自定义HeaderRow的GridView控件][示例代码下载]
- Asp.net 2.0 自定义控件开发[创建自定义浮动菜单FloadMenu控件][示例代码下载]
- Asp.net 2.0 自定义控件开发[创建自定义HeaderRow的GridView控件][示例代码下载]
- Asp.net 2.0 自定义控件开发[创建自定义右键PopupMenu控件][示例代码下载]
- Asp.net 2.0 自定义控件开发[创建自定义HeaderRow的GridView控件][示例代码下载]
- Asp.net 2.0 自定义控件开发[创建自定义浮动菜单FloadMenu控件][示例代码下载]
- Asp.net 2.0 自定义控件开发[创建自定义HeaderRow的GridView控件][示例代码下载]
- Asp.net 2.0 自定义控件开发[创建自定义浮动菜单FloadMenu控件][示例代码下载]
- Asp.net 2.0 自定义控件开发[创建自定义右键PopupMenu控件][示例代码下载]
- Asp.net 2.0 自定义控件开发[创建自定义HeaderRow的GridView控件][示例代码下载]
- 关于 文件下载--------代码没有报错,又不弹出下载框,执行下载无反应的问题
- Asp.net 2.0 自定义控件开发[创建自定义右键PopupMenu控件][示例代码下载]
- Asp.net 2.0 自定义控件开发[创建自定义右键PopupMenu控件][示例代码下载]