Android studio 如何在Android Studio中共享item RecyclerView类图像中的RelativeLayout
我的物品回收视图中有Relativelayout, 我想在单击按钮时像图片一样共享此项目。\u share==Android studio 如何在Android Studio中共享item RecyclerView类图像中的RelativeLayout,android-studio,android-recyclerview,android-relativelayout,Android Studio,Android Recyclerview,Android Relativelayout,我的物品回收视图中有Relativelayout, 我想在单击按钮时像图片一样共享此项目。\u share==shareThisScore() 请任何人帮帮我 Xml项: <?xml version="1.0" encoding="utf-8"?> <androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/a
shareThisScore()代码>
请任何人帮帮我
Xml项:
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
app:cardCornerRadius="4dp"
android:layout_marginBottom="2dp"
>
<RelativeLayout
android:id="@+id/relativeLayoutLastScore"
..
>
<TextView .. />
<androidx.cardview.widget.CardView ..>
<TextView ../>
</androidx.cardview.widget.CardView ...>
.
.
.
.
<ImageButton
android:id="@+id/imageButtonShare"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_marginEnd="15dp"
android:layout_marginRight="15dp"
android:layout_marginBottom="7dp"
android:background="@drawable/custom_button"
android:src="@drawable/ic_share"/>
</RelativeLayout>
</androidx.cardview.widget.CardView>
你面临的问题是什么?谢谢你的反应,我是初级水平的初学者,我想在用户点击按钮时将relativeLayoutLastScore转换为relativeLayoutLastScore以像图片一样共享“imageButtonShare”请注意,RecyclerView objectOk中的所有内容,因此您希望实现一个系统,在该系统中,您的用户可以将他们在图像视图中的最后得分分享给他们的朋友,或者类似的东西,对吗?是的,正是如此,我希望像图像一样分享得分。正如您所说,是的,我可以像文本一样分享项目,但不能像图像一样。请注意,如果对象位于recyclerview之外,我可以将其作为图像共享。
public void onBindViewHolder(@NonNull ScoreViewHolder holder, int position) {
ScoreItem currentItem = mScoreList.get(position);
holder.mImageViewRank.setImageResource(currentItem.getImageViewRank());
holder.mTextViewScore.setText(currentItem.getTextViewScore());
.
.
.
holder.mImageButtonShare.setOnClickListener(v -> {
shareThisScore();
} );
}