Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Glynax · Sep 03, 2015 at 10:26 PM · androidgameobjectiosinputmobile

Cells for a mobile app stacked vertically, not moving correctly

Hi,

I have a mobile app I'm trying to make with many cells that look like the attached picturealt text

My main problem is the function I'm including at the end of this question. That function expands or collapses the cell with an animation (which just increases or decreases the entire cells Size.Delta.y) And moves all the cells up or down so no cells are ever inside another or so that there is no extra space between the cells. This code does all this fine enough but if you tap any of the cells fast enough they at best will sometimes have the cell collapse but the text won't be hidden so it's just inside the cell, in the attached picture for example that would be an expanded cell, so the gambling line an everything below it would be inside the cells main area overlapping with the location and times. And at worst the cells will be partially overlapping with other cells. Very noticeably overlapping, not just a little off. Or they jump up or down and leave some empty space where the cell used to be.

Also one last bug I can't find anywhere is when I launch the app on my phone at the black screen before it loads and even at the unity splash (I don't have unity pro yet) if I tap the screen before I can even see the cells during the unity splash or black screen it seems to still interact with the buttons and the entire program seems to glitch out in various ways.. Is there a way to lock any input to the screen until After the cells are all loaded up and the initializing scripts are done? Like accept no input until the first frame of the app is loaded, after the unity splash.

Thanks in advance for any help.

This is being called as a Coroutine and being passed the cell that was tapped on

public IEnumerator DropDownCell(GameObject CurrentCell) {

     #region Assign Variables
  
     CurrentCell.GetComponent<CSVLoad>().bDropDown = CurrentCell.GetComponent<Button>();

     foreach (Button button in CurrentCell.GetComponentsInChildren<Button>())
     {
         if (button.name == "Phone Number")
         {
             CurrentCell.GetComponent<CSVLoad>().bPhoneNum = button;
         }
         else if (button.name == "Location Address")
         {
             CurrentCell.GetComponent<CSVLoad>().bLocation = button;
         }
     }

     float CurrCellY = CurrentCell.GetComponent<RectTransform>().anchoredPosition.y;
     float CurrCellHeight = CurrentCell.GetComponent<RectTransform>().sizeDelta.y;

     #endregion



     if (!CurrentCell.GetComponent<CSVLoad>().flag)
     {

         CurrentCell.GetComponent<Animator>().Play("CellExpand");
         CurrentCell.GetComponent<CSVLoad>().flag = true;
         CurrentCell.GetComponent<CSVLoad>().Expanded = true;

         yield return new WaitForSeconds(.15f);

         CurrentCell.GetComponent<CSVLoad>().ExpandedCell.SetActive(true);

         CurrentCell.GetComponent<CSVLoad>().bPhoneNum.interactable = true;

         foreach (GameObject Cell in CellList)
         {
             float cellY = Cell.GetComponent<RectTransform>().anchoredPosition.y;
             float cellHeight = Cell.GetComponent<RectTransform>().sizeDelta.y;




             if (cellY < CurrCellY)
             {

                 Cell.GetComponent<RectTransform>().anchoredPosition
                     = new Vector2(Cell.GetComponent<RectTransform>().anchoredPosition.x,
                     cellY -= 203f);


             }

         }


     }

     else if (CurrentCell.GetComponent<CSVLoad>().flag)
     {


         CurrentCell.GetComponent<Animator>().Play("CellCollapse");
         CurrentCell.GetComponent<CSVLoad>().flag = false;
         CurrentCell.GetComponent<CSVLoad>().Expanded = false;

         yield return new WaitForSeconds(.01f);

         CurrentCell.GetComponent<CSVLoad>().ExpandedCell.SetActive(false);

         foreach (GameObject Cell in CellList)
         {
             float cellY = Cell.GetComponent<RectTransform>().anchoredPosition.y;
             float cellHeight = Cell.GetComponent<RectTransform>().sizeDelta.y;


            
             CurrentCell.GetComponent<CSVLoad>().bPhoneNum.interactable = false;
             if (cellY < CurrCellY)
             {

                 Cell.GetComponent<RectTransform>().anchoredPosition
                     = new Vector2(Cell.GetComponent<RectTransform>().anchoredPosition.x,
                     cellY += 203f);


             }

         }

     }

     yield return null;

}

11542615-10152542210947537-1146208067-o.jpg (47.2 kB)
Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

29 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Mecanim for Mobile Devices 2 Answers

Vertical mobile input 0 Answers

Using the Volume Control Buttons On Mobile Devices 0 Answers

Video player app button touch input working on android not on ios 0 Answers

Third party patching software for mobile? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges