1

I'd like to construct a CGRect for a videoplayer which shows a video that needs to be shown at a fixed size, say 2cm*2cm. How do I specify these dimensions so that it works on different devices?

T. S.
  • 11
  • 3
  • 1
    what if the devices screen is less than that? this is not the way of making UI on iOS. – Julian Aug 05 '15 at 12:10
  • assuming that the screen is large enough of course. This shouldn't pose any real issues with current iPhone devices. I need this specific dimensions because of a piece of hardware that fits over the phone. – T. S. Aug 05 '15 at 12:18
  • Perhaps this question should give you a starting point http://stackoverflow.com/questions/3860305/get-ppi-of-iphone-ipad-ipod-touch-at-runtime You can transform pixels per INCH in to pixels per CM and then allocate enough pixels to match your requirements – Coldsteel48 Aug 05 '15 at 12:24
  • @Roma-MT this is very old-fashioned way of thinking. Look at latest WWDC and see that they recommends stop thinking in terms of resolution, orientation and device. UI has to be adaptive. – Julian Aug 05 '15 at 12:27
  • @JulianKról Op has mentioned that he has something external on top of the device... I don't see another way of acquiring it. In anyway he need 2CM on 2CM and he can Acquire it from PPI I don't see another magical methods to do so. – Coldsteel48 Aug 05 '15 at 12:28
  • so that solution will be extremely fragile and wrote using worst practices possible, right, this is a developer choice – Julian Aug 05 '15 at 12:31
  • @JulianKról The answer itself clearly mentioned that. However it could be more adaptive and NICE if Apple were define the Screen Size in INCH/CM or just a DPI or more correct PPI in `UIScreen` If you have better solution then go ahead and make an answer. – Coldsteel48 Aug 05 '15 at 12:33
  • Apple introduces more and more devices with different resolutions and possibilities so for sure they are going far way from designing UI on cm/inches. Maybe the concept of requiring 2x2 cm object is incompatible? – Julian Aug 05 '15 at 12:36
  • @JulianKról Maybe - This is a question to OP's Product managers. Yes they introducing more and more devices, but how is it connected to point PPI or INCH/CM? They still can add it as a parameters. – Coldsteel48 Aug 05 '15 at 12:38
  • @JulianKról Yes, the OP will have to make an app update every time APPLE introduces new device - Yes the life is not perfect. – Coldsteel48 Aug 05 '15 at 12:41
  • I think the concept of I want this 2cmx 2cm is wrong. Look how qr codes or barcodes works, you do not need any special size. I would rethink that product before going further :) – Julian Aug 05 '15 at 12:41
  • @JulianKról Is QR code An external Hardware on top of iPhone? I wouldn't suggest rethink the product before I actually know what the product is. "I need this specific dimensions because of a piece of hardware that fits over the phone" is unclear what is it, but does not sound to me as something that iPhones Camera involved in. – Coldsteel48 Aug 05 '15 at 12:45
  • It is not on top of but I wanted it as an example of flexibility. So we are missing the info to help solving the issue. To be more technical iOS rather bases on points units than cm/inches so I would follow this than any trouble making calculations based on many factors. Simplicity over complexity :) – Julian Aug 05 '15 at 12:49
  • @Julian Król So you want external device to bend itself according to the device's points ? – Coldsteel48 Aug 05 '15 at 12:58
  • I do not want anything to bend. I think that design/product should fit the platform not the other way round. Do you want to create something fragile and bug prone? I'm a big fan of clever design and simple solutions if you like different go ahead. I'm just saying it is wrong way of thinking -you say it is nice idea, propose the solution. Okay I'm not going to repeat myself n-times, its a waste of time. – Julian Aug 05 '15 at 13:13
  • @Julian Król Op asked something that he need for his product, you are claiming that his product is not right, how is it helps the OP ? If I will ask you how to paint a banana to the red color and you will tell me you should paint a cabbage instead is it helps me ? and after all who wastes time ? – Coldsteel48 Aug 05 '15 at 13:18
  • okay so not wasting a time is considering something totally wrong? c'mon man you are making this discussion giving no worth feedback at all. I helped him answering, repeat it if you missed it somehow, it is not the way the design should be done. My first comment even get some applause. have a nice day man. – Julian Aug 05 '15 at 13:25
  • @JulianKról first of all the "applause" came from me. second you are not understanding the question and make nonsense comments, ONCE AGAIN HE HAS AN EXTERNAL DEVICE THAT HE PROBABLY PUTS ON IPHONE SCREEN AND HE HAS TO MATCH HIS UI TO THE DEVICE. Now take a break and think of it. P.S. It is easy. – Coldsteel48 Aug 05 '15 at 13:29
  • @JulianKról And yes I upvoted your comment because I didn't know he has an external device.] – Coldsteel48 Aug 05 '15 at 13:31
  • calm down man... I think before writing comments. you are making irrationals examples but still no advice how to fix the issue. What if some external device doesn't fit apple products because of the different interface? would you try to fly sitting on a bike? – Julian Aug 05 '15 at 13:35
  • @JulianKról No, I just pointed the OP to the starting point and advised what to do, instead of making claims that his product is wrong. Can you see the difference ? – Coldsteel48 Aug 05 '15 at 13:38
  • if that would be a good advice then I would be the first one upvoting. – Julian Aug 05 '15 at 13:39
  • @JulianKról To judge the advice is up to you, and it is your private judgement until you have a better solution -Till you have a better working and non bugs prone solution You can not claim nothing. Not to mention, me and the answerer in the Question I showed, mentioned that the solution is not perfect but there is no other way to acquire it. – Coldsteel48 Aug 05 '15 at 13:41
  • @JulianKról And if you want more claims then go to the question I posted initially and read the last answer with it's comments. – Coldsteel48 Aug 05 '15 at 13:43
  • so basically this is what I'm saying since the very beginning – Julian Aug 05 '15 at 14:04

0 Answers0