Innovation stems from imitation 6: creating a configuration interface for the iPhone-like group list

Source: Internet
Author: User

 

This effect has been seen many times now, such as "My Documents" on Sina Weibo client, settings in miui, "business cards" in MI chat, and so on. IPhone, you cannot afford to hurt Android programmers.

 

 

The implementation of this function is very simple. If you want to be simple, it is a picture and layout problem. Today, I continue to talk about it, decompile the rice chat code, and find what we need from its Res.

 

Images in RES/drawable-hdpi/namecard_xxxxxxx are the resources we need. The pictures made by Xiaomi designers are finer, much better than those made by Sina.

 

There are two ways to use it. Mi Chat's "business card" is a listactivity, so, define an item class to encapsulate each project (display name, pop-up text edit box, select box, value, etc.), and then in getview of arrayadapter, load the corresponding layout for different items to display.

 

However, I think the simpler method is to put it directly in a layout. There are not many dynamic projects on the page anyway, so you can simply use a common activity, and listactivity is a waste of learning.

 

<Relativelayout <br/> Android: paddingtop = "10.0dip" <br/> Android: paddingbottom = "5.0dip" <br/> Android: layout_width = "fill_parent" <br/> Android: layout_height = "wrap_content"> </P> <p> <framelayout <br/> Android: layout_gravity = "center" <br/> Android: Background = "@ drawable/settings_item_bkg_left" <br/> Android: Id = "@ + ID/settings_basic_avatar_cont" <br/> Android: paddingleft = "10.0dip" <br/> Android: paddingtop = "10.0dip" <br/> Android: paddingright = "10.0dip" <br/> Android: paddingbottom = "2020.dip" <br/> Android: layout_width = "10020.dip" <br/> Android: layout_height = "110.0dip"> <br/> <imageview <br/> Android: layout_gravity = "center" <br/> Android: Id = "@ + ID/settings_basic_avatar" <br/> Android: layout_width = "80.0dip" <br/> Android: layout_height = "80366dip" <br/> Android: src = "@ drawable/avatar_default" <br/> Android: scaletype = "centercrop"/> <br/> </framelayout> <br/> <linearlayout <br/> Android: id = "@ + ID/settings_basic_name_cont" <br/> Android: Background = "@ drawable/settings_item_rt_bg" <br/> Android: layout_torightof = "@ ID/settings_basic_avatar_cont" <br/> Android: layout_aligntop = "@ ID/secret" <br/> Android: layout_width = "fill_parent" <br/> Android: layout_height = "wrap_content"> <br/> <textview <br/> Android: textsize = "16.0dip" <br/> Android: textcolor = "# c0000000" <br/> Android: layout_gravity = "Left | Center" <br/> Android: Id = "@ + ID/settings_basic_name" <br/> Android: layout_width = "0.0dip" <br/> Android: layout_height = "wrap_content" <br/> Android: layout_marginleft = "10.0dip" <br/> Android: TEXT = "nick name" <br/> Android: layout_weight = "1.0"/> <br/> <imageview <br/> Android: layout_gravity = "center_vertical" <br/> Android: layout_width = "wrap_content" <br/> Android: layout_height = "wrap_content" <br/> Android: layout_marginright = "10.0dip" <br/> Android: scaletype = "fitxy" <br/> Android: src = "@ drawable/item_clickable"/> <br/> </linearlayout>

 

In fact, it is the background of each element. You can select an appropriate white background image with rounded corners for the background to achieve the effect. Of course, the entire page should be light gray.

 

In this case, OK. It's really easy, but the effect just comes out.

 

 

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.