国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

new to android. How to implement one paragraph of text, one picture and one paragraph of text like NetEase news page?
曾經(jīng)蠟筆沒有小新
曾經(jīng)蠟筆沒有小新 2017-05-16 13:30:18
0
11
1915

I know that TextView displays text and ImageView displays pictures. However, news content is dynamic and may include multiple texts and images, and the number is variable. How to achieve this?

And like editors, they use an Html editor such as CKEditor to edit news content and save a piece of text in html format in the field. It shouldn’t be possible with TextView and ImageView, right? I haven't seen any control with this function.

Is it made into an H5 page and displayed with WebView? Is there any other plan? How does NetEase News do it?

曾經(jīng)蠟筆沒有小新
曾經(jīng)蠟筆沒有小新

reply all(11)
黃舟

Of course there are other solutions, you can use RecyclerView/ListView to implement it, and use different layouts for text and pictures

洪濤

That’s right, it’s h5, including the SegmentFault problem interface, which is also made of h5.

黃舟

Isn’t this implemented using ListView? ListView combined with adapter can meet your needs

給我你的懷抱

Basically, news pages are implemented in HTML5. This is the advantage of HTML5. Because news editors edit rich text, it is most convenient to display it directly in the form of HTML5

黃舟

Open the display layout border on your phone and take a look again

僅有的幸福

A picture displayed by default. The data is displayed after the data is loaded. It is actually a state before the data is loaded. It used to be a blank page

劉奇

What you are talking about is rich text display. In fact, TextView can do it. It loads html data and parses it.
You can check out this library: https://github.com/Sufficient...
Of course, you can also use WebView

曾經(jīng)蠟筆沒有小新

TextView uses rich text functionSpannableto achieve mixed arrangement of images and text

我想大聲告訴你

The display of layout boundaries is more reliable. Since you want to imitate others, you have to know what they are using. Generally speaking, H5 has the best display effect, but it needs to deal with the interaction problem with the native one; then rich text is more difficult to control, and the text There are a series of issues such as styles and picture sizes; finally, the method of matching different item styles through viewtype is also a good method, and there should not be too many reference codes.

淡淡煙草味

Generally used directlyHtml5

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template