My Blog

Some ridiculous behavior of ios and android

No comments

There a few things that are really weird and undocumented which will cost you hours to figure out. Just to list a few:

  1. on android, 9 patch pictures are often used as background. However, if you set any padding to your view (e.g., <TextView padding=”4dp”>), then your content padding of the 9 patch will not be working.
  2. on iOS, for UICollectionView, if somehow your cell view size is greater than the property cell size, then none of your views will be shown. in fact, the cellForItemAtIndexPath: is not called at all even if you returned a non-zero value for the numberOfItemsInSection: method.
  3. on iOS, if you want to align the text in a label on the top, there no easy way. however, you can achieve it by adding extra “\n” to the text, like “\n\n\n” if your label is set to 3 lines, then your text will be top aligned.
shawnSome ridiculous behavior of ios and android

Leave a Reply

Your email address will not be published. Required fields are marked *