Example of dialog pop-up from the bottom of Android implementation (I)

@H_ 502_ 2 @ I. overview

Let's see the renderings first:

@H_ 502_ 2@

Click the display pop-up button in the middle to pop up a dialog box from the bottom. Users can click to take photos or select from the album to perform corresponding operations. Let's see how to implement it.

@H_ 502_ 2 @ II. Code implementation

The main page layout file is very simple. It is a button to respond to click events:

Next, look at the layout of the dialog box:

The root layout is a vertical linear layout, with a background, white rectangle, and four corner radians of 5dp. The code is as follows

In a linear layout, there are two textviews and a horizontal line. It's also very simple

Here is the Java code:

Window style:

The animation code appears in the dialog box:

Code for the dialog box to disappear:

@H_ 502_ 2 @ III. summary

The dialog implemented this time is mainly implemented through textview, and no status selector and cancel button are added. The presentation of the dialog will be slightly changed in the next article. To meet the development needs of the project.

The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>