Answer the question
In order to leave comments, you need to log in
How to get the height value of the TextView field before running the application?
Hello, in my application I need to get the value of the height of the text field when the application has started, but it has not yet been interacted with. For example, display a Toast message with the height value immediately after launch.
Answer the question
In order to leave comments, you need to log in
Try like this
someTextView.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
//here
}
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question