相关疑难解决方法(0)

扩展类ImageView时出错

我间歇性地得到了InflateException/ClassNotFoundException错误.我之前在SO中看到过类似的错误,但它们是由拼写错误引起的.我正确地拼写了'ImageView',所以我不知道是什么导致了错误.

发生错误的代码是:

v = View.inflate(getContext(), R.layout.event_show_row_layout, null);
Run Code Online (Sandbox Code Playgroud)

这是布局xml:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical" >

    <RelativeLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:paddingLeft="10dip"
        android:paddingRight="10dip" >

        <TextView
            android:id="@+id/fromTextView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textSize="12sp"
            android:textStyle="italic" />

        <TextView
            android:id="@+id/timeTextView"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:gravity="right"
            android:textSize="12sp"
            android:textStyle="italic" />
    </RelativeLayout>

    <RelativeLayout
        android:id="@+id/layoutPostImage"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:padding="4dp" >

        <ImageView
            android:id="@+id/postImageView"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_alignParentTop="true"
            android:layout_margin="2dp"
            android:adjustViewBounds="true"
            android:background="@drawable/timeline_image_border"
            android:contentDescription="@string/hello"
            android:paddingBottom="6dp"
            android:scaleType="fitXY"
            android:src="@drawable/timeline_image_dummy" />
    </RelativeLayout>

    <RelativeLayout
        android:id="@+id/wordsRelativeLayout"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" >

        <TextView
            android:id="@+id/wordsTextView"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:gravity="center_vertical|center_horizontal"
            android:paddingLeft="50dp"
            android:paddingRight="50dp"
            android:text="@string/hello" />

        <ImageView
            android:id="@+id/topLeftQuoteImageView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true" …
Run Code Online (Sandbox Code Playgroud)

android inflate-exception

18
推荐指数
8
解决办法
4万
查看次数

如何将svg中的一条路径分成两条路径

我对 svg 语法非常陌生,我想知道如何将一条路径分成两条路径。实际上我有这样的东西:

M Xm Ym ... C Xc1 Yc1 Xc2 Yc2 Xc3 Yc3 (*) C Xd1 Yd1 Xd2 Yd2 Xd3 Yd3 C ...

(*) 是我要分割路径的地方

我想将其转换为两个路径,如下所示:

M Am Bm ... C Ac1 Bc1 Ac2 Bc2 Ac3 Bc3

M An Bn C Ad1 Bd1 Ad2 Bd2 Ad3 Bd3 ...

如何通过X和Y数字计算A和B数字?

svg

6
推荐指数
1
解决办法
9556
查看次数

标签 统计

android ×1

inflate-exception ×1

svg ×1