UGUI interactive component ScrollView

1. Structure of ScrollView Object Description Scroll View The main object with the Scroll Rect component attached Viewport Scrolling display area, with Image and mask components Content The parent node of the displayed content is only a Rect Transform component Scrollbar Horizontal Horizontal scroll bar Scrollbar Vertical Vertical scroll bar 2. Properties of Scroll Rect […]

Use of PreferenceKey/preference key, GeometryPreferenceKey/geometry view preference key, ScrollViewOffsetPreferenceKey/scroll view offset preference key

1. Basic use of PreferenceKey preference key 1.1 Create a basic usage view of the preference key PreferenceKeyBootcamp.swift import SwiftUI /// Preferences/Preferences key struct PreferenceKeyBootcamp: View { @State private var text: String = “Hello, world!” var body: some View { NavigationView { VStack { SecondaryScreen(text: text) .navigationTitle(“Navigation Title”) } } .onPreferenceChange(CustomTitlePreferenceKey.self) { value in if […]

ScrollView nested ListView or ExpandableListView has sliding conflicts and height calculation errors.

Problem description ScrollView nested ListView or ExpandableListView has sliding conflicts and height calculation errors. Cause analysis: 1. Android officially does not recommend sliding nesting. The sliding nesting system cannot determine which control the sliding event is triggered in. 2. When ScrollView nests ListView, there will also be a problem that ListView only displays one row. […]

ScrollViewReader/Positioning scroll view, GeometryReader/Getting view update parameters, MultipleSheets/Multiple working views, Mask/Usage of five-star evaluation view

1. ScrollViewReader positions the scroll view 1.1 Implementation /// Position the scroll view struct ScrollViewReaderBootcamp: View { @State var scrollToIndex: Int = 0 @State var textFiledText: String = “” var body: some View { VStack { TextField(“Enter a # here…”, text: $textFiledText) .padding(.horizontal) .frame(height: 55) .border(Color.gray) .padding(.horizontal) .keyboardType(.numberPad) Button(“Scroll now”) { // add animation if […]

ScrollView source code annotations

abstract class ScrollView extends StatelessWidget {<!– –> const ScrollView({<!– –> super.key, this.scrollDirection = Axis.vertical, this.reverse = false, this.controller, this.primary, ScrollPhysics? physics, this.scrollBehavior, this.shrinkWrap = false, this.center, this.anchor = 0.0, this.cacheExtent, this.semanticChildCount, this.dragStartBehavior = DragStartBehavior.start, this.keyboardDismissBehavior = ScrollViewKeyboardDismissBehavior.manual, this.restorationId, this.clipBehavior = Clip.hardEdge, }) : assert(scrollDirection != null), assert(reverse != null), assert(shrinkWrap != null), assert(dragStartBehavior != null), […]

cocos2d-x lua uses ScrollView to implement virtual list

–Create a virtual list class local VirtualList = class(“VirtualList”) —@param scrollView ccui.ScrollView function VirtualList:ctor(scrollView,data,callback, offset) self.scrollView=scrollView — self.scrollView:setClippingEnabled(false) local model =scrollView:getChildByName(“model”) model:setAnchorPoint(cc.p(0,1)) self.itemPrefab =model model:retain() self.callback=callback self.offset=offset or 5 self.itemContent={} self.scrollView:removeAllChildren() self.scrollViewSize =self.scrollView:getContentSize() self.item_h =self.itemPrefab:getContentSize().height self.item_w =self.itemPrefab:getContentSize().width self.onEvent=false self.selectUPId =0 self.selectDownId=0 self:initData(data) self:creatrViewMaxItems() self.lastPosition = cc.p(0, -self.content_h + self.scrollViewSize.height) self.scrollView:onNodeEvent(“exit”, function() self:disableNodeEvents() end) self.scrollView:setScrollBarEnabled(false) end […]

[100 Unity Practical Skills] | Unity UGUI ScrollView slides to the specified position

Unity Small Science The old rules, first introduce the popular science knowledge of Unity : Unity is a real-time 3D interactive content creation and operation platform. Including game development, art, Architecture, Automotive Design, Video All creators, including font>, turn ideas into reality with Unity . Unity The platform provides a complete set of software solutions […]

iOS development – UIScrollView nested tableView to achieve top tab horizontal switching

iOS development – UIScrollView nested tableView to achieve top tab horizontal switching Nest two TableView left and right switching functions through ScollView 1. UIScollView UIScrollView is a scrollable control, here initialization needs to set _backScollView.pagingEnabled = YES; code show as below _backScollView = [[UIScrollView alloc] initWithFrame:CGRectZero]; _backScollView.backgroundColor = [UIColor colorWithHexString:@”ffffff”]; _backScollView.showsHorizontalScrollIndicator = NO; _backScollView.showsVerticalScrollIndicator = […]

ScrollView of cocosCreator

Version: 3.4.0 Reference: ScrollView component Introduction The ScrollView component is used as a scrolling container. Its implementation uses the ScrollBar component to display the position of the content and the Mask component to display the specified area to ensure that more content is displayed in a limited area. It consists of: ScrollBar is related to […]