我使用BubbleView库。在我看来,我已正确注册了所有内容,但bubbleview的箭头和背景对我而言并不奏效。可能是什么问题呢?
XML文件
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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:background="@color/colorBackGround"
android:orientation="vertical">
<TextView
android:id="@+id/dialog_item_username"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:layout_marginTop="5dp"
android:fontFamily="sans-serif-light"
android:text="spark"
android:textColor="@color/colorWhite"
android:textSize="20sp"
android:textStyle="bold" />
<com.github.library.bubbleview.BubbleTextView
android:id="@+id/dialog_item_message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/dialog_item_username"
android:layout_marginTop="5dp"
android:layout_alignParentStart="true"
android:fontFamily="sans-serif-light"
android:padding="10dp"
android:text="Message"
android:textColor="@color/colorWhite"
app:arrowWidth="10dp"
app:bubbleColor="@color/colorSecondBackGround"
app:angle="20dp"
app:arrowHeidth="20dp"
/>
</RelativeLayout>
摇动
implementation 'com.github.lguipeng:BubbleView:1.0.1'
And this is what happens
最佳答案
尝试了以下代码:
<RelativeLayout 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:background="#000000"
android:orientation="vertical">
<TextView
android:id="@+id/dialog_item_username"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="5dp"
android:layout_marginTop="5dp"
android:fontFamily="sans-serif-light"
android:text="spark"
android:textColor="#FFFFFF"
android:textSize="20sp"
android:textStyle="bold" />
<com.github.library.bubbleview.BubbleTextView
android:id="@+id/dialog_item_message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/dialog_item_username"
android:text="Message"
android:padding="8dp"
app:angle="16dp"
app:arrowLocation="top"
app:arrowCenter="true"
app:arrowPosition="16dp"/>
<com.github.library.bubbleview.BubbleTextView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello BubbleTextVew"
android:textSize="20sp"
android:layout_below="@+id/dialog_item_message"
android:padding="10dp"
android:textColor="@android:color/white"
app:arrowWidth="8dp"
app:angle="8dp"
app:arrowHeight="10dp"
app:arrowPosition="14dp"
app:arrowLocation="left"
app:bubbleColor="#7EC0EE"/>
</RelativeLayout>
关于java - 无法使用BubbleTextView,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/59035636/