<!--
{
  "availability" : [
    "tvOS: 9.0.0 - 18.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "TVMLKit",
  "identifier" : "/documentation/TVMLKit/TVViewElementStyle",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "TVMLKit"
    ],
    "preciseIdentifier" : "c:objc(cs)TVViewElementStyle"
  },
  "title" : "TVViewElementStyle"
}
-->

# TVViewElementStyle

A style applied to a view element.

```
class TVViewElementStyle
```

## Topics

### Retrieving the Style for an Element

[`value(propertyName:)`](/documentation/TVMLKit/TVViewElementStyle/value(propertyName:))

Returns the value associated with a given style name.

### Defining the Height and Width of an Element

[`height`](/documentation/TVMLKit/TVViewElementStyle/height)

The height, in pixels, for an element.

[`maxHeight`](/documentation/TVMLKit/TVViewElementStyle/maxHeight)

The maximum height, in pixels, for the element.

[`maxWidth`](/documentation/TVMLKit/TVViewElementStyle/maxWidth)

The maximum width, in pixels, for an element.

[`minHeight`](/documentation/TVMLKit/TVViewElementStyle/minHeight)

The minimum height, in pixels, for an element.

[`minWidth`](/documentation/TVMLKit/TVViewElementStyle/minWidth)

The minimum width, in pixels, for an element.

[`width`](/documentation/TVMLKit/TVViewElementStyle/width)

The width, in pixels, for an element.

### Aligning and Positioning an Element

[`alignment`](/documentation/TVMLKit/TVViewElementStyle/alignment)

A value indicating how an item is aligned inside of an element.

[`TVElementAlignment`](/documentation/TVMLKit/TVElementAlignment)

Location of an item inside of an element on the horizontal axis.

[`contentAlignment`](/documentation/TVMLKit/TVViewElementStyle/contentAlignment)

A value indicating how items inside of an element are aligned.

[`TVElementContentAlignment`](/documentation/TVMLKit/TVElementContentAlignment)

Location of items inside of an element on the vertical axis.

[`focusMargin`](/documentation/TVMLKit/TVViewElementStyle/focusMargin)

The amount of space, in pixels, a custom cell requires when it comes into focus.

[`interitemSpacing`](/documentation/TVMLKit/TVViewElementStyle/interitemSpacing)

The spacing, in pixels, between items inside of an element.

[`margin`](/documentation/TVMLKit/TVViewElementStyle/margin)

The amount of space, in pixels, between the element and other elements.

[`padding`](/documentation/TVMLKit/TVViewElementStyle/padding)

The amount of space, in pixels, between the border and the contents of the element.

[`position`](/documentation/TVMLKit/TVViewElementStyle/position)

A value indicating the position of the element relative to the screen or its containing element.

[`TVElementPosition`](/documentation/TVMLKit/TVElementPosition)

Location of an element relative to the screen or its containing element.

### Changing the Text of an Element

[`fontSize`](/documentation/TVMLKit/TVViewElementStyle/fontSize)

The font size applied to any text contained in the element.

[`fontWeight`](/documentation/TVMLKit/TVViewElementStyle/fontWeight)

A string indicating how thick or thin the font is.

[`maxTextLines`](/documentation/TVMLKit/TVViewElementStyle/maxTextLines)

The maximum number of lines of text allowed inside of the element.

[`textAlignment`](/documentation/TVMLKit/TVViewElementStyle/textAlignment)

The horizontal alignment of text within an element.

[`textHighlightStyle`](/documentation/TVMLKit/TVViewElementStyle/textHighlightStyle)

A string indicating how a label reacts when it is in focus.

[`textMinimumScaleFactor`](/documentation/TVMLKit/TVViewElementStyle/textMinimumScaleFactor)

The minimum size text can be if the original text size does not fit in an element.

[`textStyle`](/documentation/TVMLKit/TVViewElementStyle/textStyle)

The style applied to the text in an element.

### Modifying an Image

[`imageTreatmentName`](/documentation/TVMLKit/TVViewElementStyle/imageTreatmentName)

A value that determines how an image is displayed.

[`ratingStyle`](/documentation/TVMLKit/TVViewElementStyle/ratingStyle)

A string indicating the style to be used by a rating element.

### Coloring an Element

[`backgroundColor`](/documentation/TVMLKit/TVViewElementStyle/backgroundColor)

The background color for an element.

[`color`](/documentation/TVMLKit/TVViewElementStyle/color)

The color for an element.

[`highlightColor`](/documentation/TVMLKit/TVViewElementStyle/highlightColor)

The color of the element when it is highlighted.

[`tintColor`](/documentation/TVMLKit/TVViewElementStyle/tintColor)

The tint color applied to an element.

### Element Styles

[Transition Style Values](/documentation/TVMLKit/transition-style-values)

The type of transition to apply to an element.

[Rating Style Values](/documentation/TVMLKit/rating-style-values)

The size of the star image used for a rating element.

[Label State Values](/documentation/TVMLKit/label-state-values)

How text is displayed when an element is in focus.

[Text Style Values](/documentation/TVMLKit/text-style-values)

Font size and weight.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)