无法转换为尺寸:膨胀布局时类型=0x1 [重复]

2023-12-02

我的 XML 文件

<?xml version="1.0" encoding="utf-8"?>
<com.trill.trillapp.customviews.TrillSocialNetworkBar
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/social_network"
    android:layout_width="match_parent"
    android:layout_height="@dimen/detail_social_network_bar_height"
    android:background="@color/color01">

    <ImageView
        android:id="@+id/social_facebook_bt"
        android:layout_width="90dp"
        android:layout_height="match_parent"
        android:src="@drawable/button_like_off" />

    <com.trill.trillapp.customviews.TrillNotificationTextView
        android:id="@+id/social_facebook_text"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignLeft="@+id/social_facebook_bt"
        android:layout_marginLeft="@dimen/detail_social_text_margin_left"
        android:layout_marginTop="@dimen/detail_social_bar_icon_margin"
        android:gravity="center"
        android:text="9"
        android:textColor="@color/color01"
        android:textSize="@dimen/font_f14" />

    <ImageView
        android:id="@+id/social_twitter_bt"
        android:layout_width="90dp"
        android:layout_height="match_parent"
        android:layout_toRightOf="@+id/social_facebook_bt"
        android:scaleType="center"
        android:src="@drawable/icon_sns_tw" />

    <com.trill.trillapp.customviews.TrillNotificationTextView
        android:id="@+id/social_twitter_text"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignLeft="@+id/social_twitter_bt"
        android:layout_marginLeft="@dimen/detail_social_text_margin_left"
        android:layout_marginTop="@dimen/detail_social_bar_icon_margin"
        android:gravity="center"
        android:maxLength="3"
        android:ellipsize="end"
        android:text="0"
        android:textColor="@color/color01"
        android:textSize="@dimen/font_f14" />

    <ImageView
        android:id="@+id/social_line_bt"
        android:layout_width="90dp"
        android:layout_height="match_parent"
        android:layout_toLeftOf="@+id/social_share"
        android:scaleType="center"
        android:src="@drawable/icon_sns_line" />

    <com.trill.trillapp.customviews.TrillNotificationTextView
        android:id="@+id/social_line_text"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignLeft="@+id/social_line_bt"
        android:layout_marginLeft="@dimen/detail_social_text_margin_left"
        android:layout_marginTop="@dimen/detail_social_bar_icon_margin"
        android:gravity="center"
        android:text="0"
        android:textColor="@color/color01"
        android:textSize="@dimen/font_f14" />

    <ImageView
        android:id="@+id/social_share"
        android:layout_width="90dp"
        android:layout_height="match_parent"
        android:layout_alignParentRight="true"
        android:scaleType="center"
        android:src="@drawable/icon_share_off" />

</com.trill.trillapp.customviews.TrillSocialNetworkBar>

膨胀此布局时出现以下错误:

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.trill.trillapp/com.trill.trillapp.activities.TrillDetailArticle}: 
java.lang.UnsupportedOperationException: Can't convert to dimension: type=0x1

如何修复它?


我发现 dimens.xml 文件中缺乏价值。所以会导致错误

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

无法转换为尺寸:膨胀布局时类型=0x1 [重复] 的相关文章

随机推荐

  • 同步对 ASP.NET 会话成员的访问

    我正在构建一个 Javascript 应用程序 并且 eash user 有一个单独的 UserSession 该应用程序进行大量 Ajax 调用 每个 Ajax 调用都需要访问用户的单个 UserSession 对象 每个 Ajax 调用
  • 如何从 Web 应用程序读取 web.xml

    对于 WebApps web xml 可用于存储应用程序设置 我怎样才能读取这个文件 我的 servlet 在 GlassFish v2 服务器中运行 不确定我完全理解这个问题 假设您的 Servlet 扩展HttpServlet Http
  • 如何在 OSX 上通过 Python Tkinter 安装和使用 TkDnD?

    我花了一些时间来搜索在 OSX 平台上使用 Python Tkinter 进行拖放行为的可行解决方案 找到的最可能的解决方案是 TkDnD 库 http sourceforge net projects tkdnd files 但是我找不到
  • 如何修复 Core Image 的 CILanczosScaleTransform 滤镜边框伪影?

    我想为 iOS 实现图像缩小算法 读完核心图像后CILanczosScaleTransform非常适合它 我通过以下方式实现了它 public func resizeImage image UIImage targetWidth CGFlo
  • 在扩展方法中更改数组大小不起作用?

    所以基本上我写了我的小Add数组类型的扩展方法 using System using System Linq public static class Extensions public static void Add
  • MVC(3) 句柄更新

    我正在经历Codeplex 上的本教程 这是 MusicStore 应用程序 在一个场景中 它是将音乐唱片添加到购物篮中 然后它还允许用户删除它 根据我的理解 它是通过在 Controller 中实现的 Ajax 回发来实现的 让我困惑的是
  • 如何在mysql的select中使用if/else条件

    如何在 mysql 中的 select 语句上使用 if else 条件 如果类型 初始读取 Select the Initial Column from table name否则如果 Type 最终读取 Select the Final
  • AngularJs动态下载响应

    我写了一个基于指令斯科特的回答 你会像这样使用它
  • jqgrid - 工具栏文本 - 这是一个好方法吗?

    我已指定userdata在 JSON 响应中 取决于值title财产 标题将发生变化以反映title财产 工具栏中的文本 网格标题和数据表标题之间 将发生变化 HTML table table div div JSON colModel n
  • 如何使用 CSS 拆分表格单元格中的字符串(例如长 URL)?

    情况是这样的 我正在尝试一些 MySpace 页面自定义 如果你有曾经尝试过 stackoverflow 我相信您明白这有多么令人沮丧 基本上它可以通过 CSS 在一组特定的规则内进行自定义 例如不允许使用 字符 多么有用 看看这个blog
  • if 语句中多个条件的 Python 简写[重复]

    这个问题在这里已经有答案了 if x y z print x y 这是 if x y and y z 的简写吗 它在我的代码中有效 但我不确定当多个条件不都是 或 时如何解释 或者以上面的后一种形式写出 是的 如中所述文档 比较可以是任意链
  • 如何在 MATLAB 中为符号变量赋予数字?

    我尝试使用以下代码在 MATLAB 中声明一个符号变量 syms a 我对这个变量进行了计算 一切都很好 但我的问题是 我不知道如何给变量一个数字并得到数字结果 例如我的代码的答案是 answer exp 10 a 例如我想给 a 40并得
  • 当更新 sphinx.conf 中的索引时,总是需要在 sphinx 中重新启动 searchd 吗?

    如果我更新 sphinx conf 文件中的资源 我可以使用 rotate 重新索引 一切正常 如果我更新 sphinx conf 中的索引或添加新索引 rotate 不起作用 我必须重新启动 searchd 我这样做是否正确 我觉得 ro
  • 当不涉及真正的 I/O 调用时,异步链的所有级别是否都需要ConfigureAwait(false)?

    在 Azure Document Db Client SDK 之上实现可重用适配器类型的库 该库可以在任何地方运行 不仅可以在 ASP NET Core Web 服务中运行 还可以在命令行应用程序 ASP NET Web Api 等中运行
  • R 中的 Unicode 变量名称

    我正在开发一个玩具项目 并尝试使用一些 unicode 变量名称来匹配我试图实现的论文 以下代码在 Windows 上的 R 3 4 3 RStudio 版本 1 1 456 和 OSX 上的 R 3 5 1 上运行良好 gt lt fun
  • 如何将 Thunderbird 扩展与 Lightning 集成

    我目前正在为一个项目进行初步研究 如果可行的话 该项目将包含带有 Lightning 集成的 Thunderbird 扩展 我的问题是这样的 如何使用 Thunderbird 扩展以编程方式更改 Lightning 中的 CSS 具体来说
  • Rails 2.3.9 查询参数的编码

    是否可以让rails 将查询参数解码为utf8 如果我有类似 foo param 的东西 我尝试访问控制器中的参数 该参数被编码为 ASCII 8BIT 这会导致很多事情被破坏 因为我们的许多其他字符串都是用 UTF 8 编码的 而 rub
  • 获得授权属性的许可?

    我已经实现了我自己的Authorize属性 我注意到当我使用时它会查询以检查权限 Authorize 有什么方法可以获取该权限并在应用该权限的当前控制器中使用它Authorize属性而无需重写和重新查询控制器中的代码 是的你可以 如果您将
  • iOS 8 下不显示键盘

    当专注于我的应用程序的文本字段时 它们都无法调出键盘 我无法输入任何字母 不过iOS 8之前还可以 我尝试旋转屏幕 发现键盘显示在屏幕范围之外 检查视图框架 它是1024 768 似乎是正确的 最后发现是模拟器的问题 不是iOS 8的bug
  • 无法转换为尺寸:膨胀布局时类型=0x1 [重复]

    这个问题在这里已经有答案了 我的 XML 文件