中国优质的IT技术网站
专业IT技术创作平台
IT职业在线教育平台
在entry的build.gradle中添加依赖
dependencies { ... implementation 'com.gitee.archermind-ti:bubble-popup-window-ohos:1.0.0-beta' ... }
BubblePopupWindow leftTopWindow = new BubblePopupWindow(MainActivity.this); Component bubbleView = LayoutScatter.getInstance(getContext()).parse(ResourceTable.Layout_popup_layout,null,false); leftTopWindow = new BubblePopupWindow(MainAbilitySlice.this,null); leftTopWindow.setBubbleView(bubbleView); leftTopWindow.show(component, LayoutAlignment.BOTTOM);
<com.yuyh.library.BubbleRelativeLayout ohos:height="match_content" ohos:width="match_content" app:cornerRadius="10" app:halfBaseOfLeg="18vp" app:padding="18vp" app:shadowColor="#64000000" app:strokeWidth="5" ohos:center_in_parent="true" ohos:background_element="$graphic:bubble"> <Text ohos:height="match_content" ohos:width="match_content" ohos:text="欢迎欢迎" ohos:text_size="20fp" ohos:multiple_lines="true" ohos:id="$+id:mytext" /> </com.yuyh.library.BubbleRelativeLayout>
微信扫码分享