Property "bounds" not found in type view controller

Ashish Gabani

i write a code for contain a text into a view as

-(void)buildFrames
{
    NSTextStorage *textstorege=[[NSTextStorage alloc]initWithAttributedString:self.bookMarkup];
    _layoutManager =[[NSLayoutManager alloc]init];
    [textstorege addLayoutManager:_layoutManager];
    NSTextContainer *textcontainer=[[NSTextContainer alloc]initWithSize:CGSizeMake(self.bounds.size.width, FLT_MAX)];
    [_layoutManager addTextContainer:textcontainer];
    UITextView *textView = [[UITextView alloc]initWithFrame:self.bounds textContainer:textcontainer];
    textView.scrollEnabled = YES;
    [self addSubview:textView];
}

then error is like as Property "Bounds" not found in object type view controller...

Craig

Your line:

UITextView *textView = [[UITextView alloc]initWithFrame:self.bounds textContainer:textcontainer];

If self is a UIViewController or UISplitViewController then self doesn't have bounds it's a controller. You want the bounds of the view the controller is responsible for.

Try self.view.bounds so your line becomes:

UITextView *textView = [[UITextView alloc]initWithFrame:self.view.bounds textContainer:textcontainer];

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

Setting the CALayer bounds and position from a view controller

分類Dev

Hibernate. Property not found on type

分類Dev

Expected 'property' to be of type string, instead found type object - Dynamoose

分類Dev

Spring Data with QueryDslPredicateExecutor no property findAll found for type error

分類Dev

Spring Data with QueryDslPredicateExecutor no property findAll found for type error

分類Dev

Spring Data with QueryDslPredicateExecutor no property findAll found for type error

分類Dev

How can i pass generic type from view to controller

分類Dev

Type bounds in Scala Universe design

分類Dev

Php class Controller not found

分類Dev

Enforcing Multiple Generic Bounds in Java Return Type

分類Dev

Enforcing Multiple Generic Bounds in Java Return Type

分類Dev

Two Piechart in view controller

分類Dev

InvalidArgumentException - View not found

分類Dev

Ember bind controller property to query in another controller

分類Dev

No action was found on the controller that matches the request

分類Dev

Class Controller not found while loading

分類Dev

Scala: using type parameters or abstract types as type bounds

分類Dev

EL1008E: Property or field 'content' cannot be found on object of type 'java.util.ArrayList' - maybe not public or not valid?

分類Dev

Set controller property to first model

分類Dev

Laravel Controller Type Hinting

分類Dev

Flutter - TextField "textAlign" property not found

分類Dev

Chef custom resource property not found

分類Dev

view.bounds.size.height -vs- view.bounds.height-違いはありますか?

分類Dev

Table view cell to another view controller

分類Dev

Present subclassed view controller from another view controller in Swift

分類Dev

How to swipe a View controller over the top of another view controller?

分類Dev

How to access the child view controller from parent view controller in swift?

分類Dev

Changing the size of a modal view controller

分類Dev

Fill the Model in view and pass it controller

Related 関連記事

  1. 1

    Setting the CALayer bounds and position from a view controller

  2. 2

    Hibernate. Property not found on type

  3. 3

    Expected 'property' to be of type string, instead found type object - Dynamoose

  4. 4

    Spring Data with QueryDslPredicateExecutor no property findAll found for type error

  5. 5

    Spring Data with QueryDslPredicateExecutor no property findAll found for type error

  6. 6

    Spring Data with QueryDslPredicateExecutor no property findAll found for type error

  7. 7

    How can i pass generic type from view to controller

  8. 8

    Type bounds in Scala Universe design

  9. 9

    Php class Controller not found

  10. 10

    Enforcing Multiple Generic Bounds in Java Return Type

  11. 11

    Enforcing Multiple Generic Bounds in Java Return Type

  12. 12

    Two Piechart in view controller

  13. 13

    InvalidArgumentException - View not found

  14. 14

    Ember bind controller property to query in another controller

  15. 15

    No action was found on the controller that matches the request

  16. 16

    Class Controller not found while loading

  17. 17

    Scala: using type parameters or abstract types as type bounds

  18. 18

    EL1008E: Property or field 'content' cannot be found on object of type 'java.util.ArrayList' - maybe not public or not valid?

  19. 19

    Set controller property to first model

  20. 20

    Laravel Controller Type Hinting

  21. 21

    Flutter - TextField "textAlign" property not found

  22. 22

    Chef custom resource property not found

  23. 23

    view.bounds.size.height -vs- view.bounds.height-違いはありますか?

  24. 24

    Table view cell to another view controller

  25. 25

    Present subclassed view controller from another view controller in Swift

  26. 26

    How to swipe a View controller over the top of another view controller?

  27. 27

    How to access the child view controller from parent view controller in swift?

  28. 28

    Changing the size of a modal view controller

  29. 29

    Fill the Model in view and pass it controller

ホットタグ

アーカイブ