Questions tagged [view-bound]

Visible boundaries of a drawable displayed in a view.

Retrieve or control the visible boundaries of a drawable displayed in a view.

8 questions
8
votes
1 answer

What was the reason to restrict on combining implicit parameters and view/context bounds?

One of the recent commits to Scala master removes restriction on combining context/view bounds with implicit parameters. That's a great improvement that reduces amount of boilerplate, but what was the reason of making that restriction before, and…
Vasil Remeniuk
  • 20,519
  • 6
  • 71
  • 81
3
votes
2 answers

How to express (implicit conv: String => A) as a view bound

I am asking myself what would be the view bound equivalent to (implicit conv: String => A) My first attempt was to simply declare the type parameter A as follows: [String <% A] But the Scala compiler complains with "not found: type A". Any…
Tim Friske
  • 2,012
  • 1
  • 18
  • 28
3
votes
1 answer

Implicit conversion to Seq[T] from Array[T]

I'm having some trouble with view bounds. I have written the following function, which should take any object seq viewable as a Seq[T] and return None if it is empty, or Some(seq) otherwise. def noneIfEmpty[T, S <% Seq[T]](seq: S): Option[S] = if…
zh2l4d7s
  • 97
  • 1
  • 9
3
votes
2 answers

Instantiating view bounded types using manifests

I'm trying to use Scala's manifests to instantiate a type, and I'm running into problems when that type is parameterized on types with a view bound. I've distilled the problem down to the following code: class foo[X <% Ordered[X]]() {} def…
nomad
  • 1,809
  • 2
  • 18
  • 33
2
votes
3 answers

how to get current size of a subview when device size changes in swift?

I have to view: view_1 and view_2 . view_1 height is proportional to the main view controller height and I am adding view_2 programmatically as a subview of view_1 with a proportional height. Problem when the device size changes say from iPhone 6 to…
irkinosor
  • 766
  • 12
  • 26
2
votes
0 answers

TextView - resize view bounds to fit the text after scaling the text

I am scaling down text size from 30sp to 18sp. But as show in the images below the height and width of text view remains same after scaling, leaving too much space below and above the text. Original: Scaled: Scaled with background color: How can…
Prashant Kedia
  • 318
  • 5
  • 14
1
vote
0 answers

IOS Simulator not calculating the view bounds correctly

I'm testing my app using different IOS versions on the IOS Simulator and have run into a problem with IOS 7.1 I'm checking the dimensions in the following way: float height = [[UIScreen mainScreen]bounds].size.height; And when I run the IOS…
Linda Keating
  • 2,215
  • 7
  • 31
  • 63
0
votes
1 answer

Why view bound and context bound fails to detect implicits present in the context

I am new to scala and I am trying to implement a method method "append" which appends two numbers or string. The ideato practice on this code came from this post where I was referring an example of append method and Appendable trait used for…
Gunjan Shah
  • 5,088
  • 16
  • 53
  • 72