首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >即使我找到了,也没有找到shape_diagonal_direction

即使我找到了,也没有找到shape_diagonal_direction
EN

Stack Overflow用户
提问于 2019-07-28 15:30:45
回答 2查看 502关注 0票数 2

以下是我从Github实现ShapeOfView库后的简单xml布局文件

代码语言:javascript
运行
复制
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:weightSum="10">

<com.github.florent37.shapeofview.shapes.DiagonalView
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:layout_weight="4"
    android:elevation="4dp"
    app:shape_diagonal_angle="6"
    app:shape_diagonal_direction="right"
    app:shape_diagonal_position="bottom">

    <ImageView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:scaleType="centerCrop"
        android:src="@drawable/homepage" />
</com.github.florent37.shapeofview.shapes.DiagonalView>

但是当我调试它的时候,我得到了这个错误:

代码语言:javascript
运行
复制
Android resource linking failed
/home/.../fragment_home.xml:9: error: attribute shape_diagonal_direction not found.
error: failed linking file resources.

为什么会这样呢?

EN

回答 2

Stack Overflow用户

发布于 2020-07-10 17:19:43

我刚刚删除了那个Attribute(app:shape_diagonal_direction="right"),,它对我很有效!使用此代码。

代码语言:javascript
运行
复制
    <com.github.florent37.shapeofview.shapes.DiagonalView
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="4"
        android:elevation="4dp"
        app:shape_diagonal_angle="6"
        app:shape_diagonal_position="bottom">
    
        <ImageView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:scaleType="centerCrop"
            android:src="@drawable/homepage" />

    </com.github.florent37.shapeofview.shapes.DiagonalView>
票数 2
EN

Stack Overflow用户

发布于 2021-05-08 02:31:57

只需删除该行,问题是因为库版本,它只是删除了该属性。

它必须是这样的:

代码语言:javascript
运行
复制
<com.github.florent37.shapeofview.shapes.DiagonalView
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:layout_weight="4"
    android:elevation="4dp"
    app:shape_diagonal_angle="6"
    app:shape_diagonal_position="bottom">

    <ImageView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:scaleType="centerCrop"
        android:src="@drawable/homepage" />
</com.github.florent37.shapeofview.shapes.DiagonalView>
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/57238819

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档