Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

该控件置于RecyclerView的Item中,拖动立马崩掉 #4

Open
gundumw100 opened this issue Aug 27, 2015 · 0 comments
Open

该控件置于RecyclerView的Item中,拖动立马崩掉 #4

gundumw100 opened this issue Aug 27, 2015 · 0 comments

Comments

@gundumw100
Copy link

你可以试试ListView,我估计也会出现这样的问题。
报的exception比较古怪:
java.lang.ClassCastException: android.widget.RelativeLayout$LayoutParams cannot be cast to android.widget.LinearLayout$LayoutParams
但是我不放入DraggableFlagView就没事!

item布局:

<TextView
    android:id="@+id/item_0"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="center_vertical|start"
    android:textAppearance="?attr/textAppearanceListItem"
    android:textColor="@android:color/holo_blue_dark"
    android:textSize="20sp" />

<com.mb.widget.DraggableFlagView
    android:id="@+id/dfv"
    android:layout_width="32dp"
    android:layout_height="32dp"
    android:layout_gravity="center_vertical|end"
    android:layout_margin="15dp"
    app:fv_color="#FF3B30" />

在Adapter中使用:
dfv = (DraggableFlagView) view.findViewById(R.id.dfv);
dfv.setOnDraggableFlagViewListener(new DraggableFlagView.OnDraggableFlagViewListener() {

            @Override
            public void onFlagDismiss(DraggableFlagView view) {
                // TODO Auto-generated method stub
                Log.i("tag", "DraggableFlagView--->onFlagDismiss");
            }
        });

dfv.setText("7");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant