iOS development--imitation NetEase News

Source: Internet
Author: User
<span id="Label3"></p> <!--?xml version="1.0" encoding="UTF-8" standalone="no"?--><p><p>Learning source: top title scroll bar in Fast integration app</p></p><p><p>Effect:</p></p><p><p></p></p>  According to this NetEase news interface, requirements analysis:    required objects:          1, navigation controller default will be generated by the navigation bar, You can set the title above (or you can also customize the View settings navigation bar Title)           2, the title scrolling area of the toggle page is a scrollview, Add six UIButton to this scrollview, in order UIButton text is "headline, hotspot, video, social, subscription, technology" Six titles           3, Toggle content The Content scrolling area is a scrollview, which is added in the title button corresponding to the title scroll area of the scrollview, respectively, about "headline, hotspot, video, social, subscription, technology" six view          4, about "headline, hotspot, video, society, subscription, technology" six view, from six custom viewcontroller.       logic:          5, drag-and-drop content scrolling area, two adjacent pages with a page change effect, one page view automatically occupy the current Page.           6, Select a caption button for the title scroll area, the selected button will automatically switch to the middle position, but the caption buttons on both sides will not be centered because of the scrolling Area.           7, Select a caption button in the title scroll area, the content scrolling area will switch to the corresponding view, render the corresponding view content           8, Click on the title of the scroll area of a title button, will toggle the status, the selected title is originally black medium size of the font switch to a large red font, the unselected title is originally a large red font switch to black medium size Font. In addition: font size and color switch to dynamic changes, will be dragged with the content scrolling area and slowly deformation or color change, rather than suddenly the end of the Change.           9, drag and drop the content scrolling area, scroll to the end of the page, the title scrolling area will then automatically switch the corresponding titlebutton, and the title scrolling area automatically toggles the center Effect. (note that this is a page after scrolling, not one side of Scrolling)   more demand effects please have time to continue in-depth study: "top title scroll bar in fast integration app"  <span style="color: #ff2600;">Additional correlation arises from the requirement that the scrolling range of the <span style="color: #ff2600;">content scrolling area and the scrolling range of the caption scrolling area are determined by the number of caption buttons, and six buttons are set six times times the Range. </span></span>well, the analysis is so detailed, then we will directly according to the above detailed requirements analysis to step-by-step implementation of this page news function Module. first, in order to encapsulate this part of the function, I used the xib, but xib when using the navigation controller class, I encountered the navigation controller class cannot set the title of the navigation bar, then I had to use the custom viewcontroller, and then use the UIView custom simulation to set the navigation bar, Then add Uilabel in the middle of the navigation bar, and then add two scrollview on this xib, and add the automatic layout for them, the automatic layout here is not difficult, the self-realization of their own, here is not detailed: and then according to the above demand<p><p></p></p><p><p>According to requirements 6 and 7, Below:</p></p><p><p></p></p><p><p>Let me repeat the remaining requirements:</p></p>8, Click on the title Scroll area of a title button, will toggle the status, the selected title is originally Black medium-sized font switch to a large red font, uncheck the title is originally a large red font switch to black size medium font.          In addition: font size and color switch to dynamic changes, will be dragged with the content scrolling area and slowly deformation or color change, rather than suddenly the end of the Change. 9. Drag and drop the content scrolling area, after scrolling over a page, the title scrolling area will then automatically toggle the corresponding caption button, and the title scrolling area automatically toggles the center Effect. (note that this is after scrolling through a page, not one side of the scrolling side changes)<p><p>According to demand 8 and demand 9, The logical event we need is to respond to scrolling, so we need to use the Uiscrollviewdelegate method:</p></p><p><p></p></p><p><p></p></p><p><p></p></p><p><p>Complete Requirement 9 First:</p></p><p><p></p></p><p><p>Then complete the requirements 8, before completing the Analysis:</p></p><p><p></p></p><p><p>The currently adjacent buttons also have left and right, then the left button size and right size ratio should be equal to the left width and right width ratio is the Same.</p></p><p><p></p></p><p><p>This adds:</p></p><p><p>In fact, basically all the needs are satisfied, but there is still a small detail is not satisfied, that is the first time to launch this page, the title is not the default setting of the selected state, that is, the default color size is not set</p></p><p><p></p></p><p><p>well, all the requirements have been basically fulfilled here.</p></p><p><p>Because this part of the module I basically package finished, so worth downloading reuse oh:</p></p><p><p>Baidu Cloud Download Link: Http://pan.baidu.com/s/1mhuzqpM password: 6BTJ</p></p><p><p>iOS development--imitation NetEase News</p></p></span>

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.