Comments (1)
Hi, thank you for your issue.
Actually it is an expected result.
The measuring size of the textView
is difficult because it is changed by every device's size of letters and languages or other environments. So If we want to get the exact size of the width/height of the textView, the textView must be inflated completely.
So PopupWindow
can't know the exact size of the textView. Because the layout will be inflated after showing up the PopupWindow
. (The layout will be inflated on the PopupWindow
.)
Fortunately, we can calculate the exact width/height size of the textView if we know the height/width size oppositely. So the basic form of the balloon (with icon and on textView) can be calculated exact height size because we know the width size of the Balloon.
Also, we can measure the exact height size of the customized popup if we know the exact width size. And there are some solutions.
1. Use fixed width/height size of the custom layout
android:layout_width="240dp"
android:layout_height="wrap_content"
or (not recommended)
android:layout_width="wrap_content"
android:layout_height="240dp"
2. Use maxWidth
By using the maxWidth
attribute, the height size of the popup can be measured exactly.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical"
android:padding="12dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxWidth="240dp"
...
from balloon.
Related Issues (20)
- Show next and previous item data without dismiss in recyclerview HOT 2
- Prevent Balloon on theme changed HOT 1
- Compose: provide the way to get the end of the sequentially showed balloons. Still not working after 1.6.3 HOT 3
- Shadow have its left and right shadow clipped HOT 5
- Getting some stuttering when doing fast scrolling. HOT 1
- The balloon is swallowing keyboard input. HOT 2
- can i set width and height dynamically? HOT 3
- Compose Balloon position is misplace HOT 6
- Compose elements with `fillMaxWidth()` are cut on the edge HOT 4
- Arrow is not showing HOT 9
- Corner radius not set properly HOT 2
- PopupWindow not seen By Appium HOT 4
- Make popup reappear in `onResume` after being dismissed in `onPause` HOT 1
- ArrowOrientation.BOTTOM and END not working in M3 ModalBottomSheet HOT 3
- request a Gaussian Blur overlay HOT 1
- How can I blur the overlay? HOT 1
- Support Compose Multiplatform
- Balloon content not visible in dark theme HOT 6
- Crash Fatal Exception: java.lang.IllegalArgumentException The width of the balloon must bigger than zero. HOT 7
- Crash: Balloon$showAlignBottom$$inlined$show$1.run error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from balloon.