> ## Documentation Index
> Fetch the complete documentation index at: https://docs-staging-feat-init-gt-translations.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> Lock.Swift のスタイル設定とカスタマイズのオプション

# Lock.swift: スタイルのカスタマイズオプション

以下に、Lock のスタイルや外観を設定するためのさまざまなオプションを示します。さらに、[動作設定オプション](/docs/ja-jp/libraries/lock-swift/lock-swift-configuration-options) のページでは、Lock の動作や機能を変更するためのオプションも多数用意されています。

<h2 id="customizing-locks-appearance">
  Lockの外観をカスタマイズする
</h2>

`withStyle` を使うと、Lock の初期化時にスタイルのカスタマイズオプションを追加できます。

```swift lines theme={null}
Lock
  .classic()
  .withStyle {
	  $0.title = "Company LLC"
	  $0.logo = LazyImage(name: "company_logo")
	  $0.primaryColor = UIColor(red: 0.6784, green: 0.5412, blue: 0.7333, alpha: 1.0)
	}
  .present(from: self)
```

<h2 id="header-style-options">
  ヘッダーのスタイル設定
</h2>

<h3 id="headerblur">
  headerBlur
</h3>

使用するぼかし効果のスタイルです。`UIBlurEffectStyle` で定義されている任意の値を指定できます。

```swift lines theme={null}
.withStyle {
  $0.headerBlur = .extraLight
}
```

<h3 id="headercolor">
  headerColor
</h3>

ヘッダーの背景色に使用する色です。デフォルトでは色はなく、ぼかしのみが適用されます。

```swift lines theme={null}
.withStyle {
  $0.headerColor = UIColor? = nil
}
```

<h3 id="logo">
  logo
</h3>

ヘッダーに表示するロゴ画像。推奨される最小サイズは、幅 200 ピクセル、高さ 200 ピクセルです。

```swift lines theme={null}
.withStyle {
  $0.logo = LazyImage(name: "company_logo")
}
```

<h3 id="headercloseicon">
  headerCloseIcon
</h3>

ヘッダーの"close"アイコンは変更できます。

```swift lines theme={null}
.withStyle {
  $0.headerCloseIcon = LazyImage(name: "ic_close")
}
```

<h3 id="headerbackicon">
  headerBackIcon
</h3>

ヘッダーの"back"アイコンは変更可能です。

```swift lines theme={null}
.withStyle {
  $0.headerBackIcon = LazyImage(name: "ic_close")
}
```

<h2 id="title-style-options">
  タイトルのスタイル設定
</h2>

<h3 id="hidetitle">
  hideTitle
</h3>

ヘッダーのタイトルを非表示にし、ロゴのみを表示します。デフォルトでは、このオプションは false です。

```swift lines theme={null}
.withStyle {
  $0.hideTitle = false
}
```

<h3 id="title">
  title
</h3>

ヘッダーに使用するタイトルテキスト

```swift lines theme={null}
.withStyle {
  $0.title = "Company LLC"
}
```

<h3 id="titlecolor">
  titleColor
</h3>

ヘッダーのタイトルに使用する色。

```swift lines theme={null}
.withStyle {
  $0.titleColor = UIColor.black
}
```

<h2 id="button-and-component-style-options">
  ボタンとコンポーネントのスタイル設定
</h2>

<h3 id="buttontintcolor">
  buttonTintColor
</h3>

プライマリボタンの色合いに使用する色です。

```swift lines theme={null}
.withStyle {
  $0.buttonTintColor = UIColor.white
}
```

<h3 id="disabledcolor">
  disabledColor
</h3>

Lock の無効状態のコンポーネントに使用される色です。

```swift lines theme={null}
.withStyle {
  $0.disabledColor = UIColor(red: 0.8902, green: 0.898, blue: 0.9059, alpha: 1.0)
}
```

<h3 id="disabledtextcolor">
  disabledTextColor
</h3>

Lock の無効状態のコンポーネントに使用されるテキスト色です。

```swift lines theme={null}
.withStyle {
  $0.disabledTextColor = UIColor(red: 0.5725, green: 0.5804, blue: 0.5843, alpha: 1.0)
}
```

<h3 id="hidebuttontitle">
  hideButtonTitle
</h3>

プライマリ ボタンのタイトルを非表示にし、アイコンのみを表示します。デフォルトでは、このオプションは false です。

```swift lines theme={null}
.withStyle {
  $0.hideButtonTitle = false
}
```

<h3 id="primarycolor">
  primaryColor
</h3>

Lock のプライマリカラーとして使用される色です。

```swift lines theme={null}
.withStyle {
  $0.primaryColor = UIColor.orange
}
```

<h2 id="input-field-styles">
  入力フィールドのスタイル
</h2>

<h3 id="inputtextcolor">
  inputTextColor
</h3>

入力フィールド内のテキストの色。

```swift lines theme={null}
.withStyle {
  $0.inputTextColor = UIColor.black
}
```

<h3 id="inputplaceholdertextcolor">
  inputPlaceholderTextColor
</h3>

入力フィールドのプレースホルダーテキストの色。

```swift lines theme={null}
.withStyle {
  $0.inputPlaceholderTextColor = UIColor(red: 0.780, green: 0.780, blue: 0.804, alpha: 1.00)
}
```

<h3 id="inputbordercolor">
  inputBorderColor
</h3>

入力フィールドの枠線の色。

```swift lines theme={null}
.withStyle {
  $0.inputBorderColor = UIColor(red: 0.780, green: 0.780, blue: 0.804, alpha: 1.00)
}
```

<h3 id="inputbordercolorerror">
  inputBorderColorError
</h3>

無効な値が入力された入力フィールドの枠線の色。

```swift lines theme={null}
.withStyle {
  $0.inputBorderColorError = UIColor.red
}
```

<h3 id="inputbackgroundcolor">
  inputBackgroundColor
</h3>

入力フィールドの背景色。

```swift lines theme={null}
.withStyle {
  $0.inputBackgroundColor = UIColor.white
}
```

<h3 id="inputiconbackgroundcolor">
  inputIconBackgroundColor
</h3>

入力フィールドアイコンの背景色です。

```swift lines theme={null}
.withStyle {
  $0.inputIconBackgroundColor = UIColor(red: 0.9333, green: 0.9333, blue: 0.9333, alpha: 1.0)
}
```

<h3 id="inputiconcolor">
  inputIconColor
</h3>

入力フィールドのアイコンの色。

```swift lines theme={null}
.withStyle {
  $0.inputIconColor = UIColor(red: 0.5725, green: 0.5804, blue: 0.5843, alpha: 1.0)
}
```

<h2 id="status-bar-styles">
  ステータスバーの表示スタイル
</h2>

<h3 id="uistatusbaranimation">
  UIStatusBarAnimation
</h3>

Lock Controllerのステータスバーを更新する際のアニメーション。

```swift lines theme={null}
.withStyle {
  $0.UIStatusBarAnimation = .none
}
```

<h3 id="statusbarhidden">
  statusBarHidden
</h3>

Lock Controllerのステータスバーの表示/非表示。

```swift lines theme={null}
.withStyle {
  $0.statusBarHidden = false
}
```

<h3 id="uistatusbarstyle">
  UIStatusBarStyle
</h3>

Lock Controllerのステータスバーのスタイル。

```swift lines theme={null}
.withStyle {
  $0.UIStatusBarStyle = .default
}
```

<h3 id="uisearchbarstyle">
  UISearchBarStyle
</h3>

Lock の<Tooltip tip="パスワードレス: 最初の認証要素としてパスワードを使用しない認証方式。" cta="用語集を見る" href="/docs/ja-jp/glossary?term=Passwordless">パスワードレス</Tooltip>検索バーのスタイル。

```swift lines theme={null}
.withStyle {
  $0.UISearchBarStyle = .default
}
```

<h2 id="other-style-options">
  その他のスタイルオプション
</h2>

<h3 id="textcolor">
  textColor
</h3>

本文のテキストの色です。

```swift lines theme={null}
.withStyle {
  $0.textColor = UIColor.black
}
```

<h3 id="backgroundcolor">
  backgroundColor
</h3>

Lock の背景色に使用する色です。

```swift lines theme={null}
.withStyle {
  $0.backgroundColor = UIColor.white
}
```

<h3 id="backgroundimage">
  backgroundImage
</h3>

Lock の背景画像として使用する画像

```swift lines theme={null}
.withStyle {
  $0.backgroundImage = LazyImage(name: "company_logo")
}
```

<h3 id="oauth2">
  oauth2
</h3>

db を除く任意の OAuth 2.0 接続では、接続名を `AuthStyle` に関連付けることでスタイルをカスタマイズできます

```swift lines theme={null}
.withStyle {
  $0.oauth2["slack"] = AuthStyle(
    name: "Slack",
    color: UIColor(red: 0.4118, green: 0.8078, blue: 0.6588, alpha: 1.0),
    withImage: LazyImage(name: "ic_slack")
  )
}
```

<h3 id="seperatortextcolor">
  seperatorTextColor
</h3>

ソーシャルログインの区切りラベルの色。

```swift lines theme={null}
.withStyle {
  $0.seperatorTextColor = UIColor(red: 0.0, green: 0.0, blue: 0.0, alpha: 0.54)
}
```

<h3 id="secondarybuttoncolor">
  secondaryButtonColor
</h3>

サブボタンの色。

```swift lines theme={null}
.withStyle {
  $0.secondaryButtonColor = UIColor.black
}
```

<h3 id="tabtextcolor">
  tabTextColor
</h3>

データベースのログインタブ上のテキストの色。

```swift lines theme={null}
.withStyle {
  $0.tabTextColor = UIColor(red: 0.3608, green: 0.4, blue: 0.4353, alpha: 0.6)
}
```

<h3 id="tabtintcolor">
  tabTintColor
</h3>

データベースのログインタブのティントカラーです。

```swift lines theme={null}
.withStyle {
  $0.tabTintColor = UIColor(red: 0.3608, green: 0.4, blue: 0.4353, alpha: 0.6)
}
```
