1

TwitterおよびFacebookの[ツイート]または[共有]をクリックしたときに表示される「テキストボックス」。それらは何でできていますか?同様の何かを作ることができますか?tableViewの「コメント」として機能するようにカスタマイズしようとしています。私はこれらの2つのことについて話している:

ここに画像の説明を入力してください

「Tweet」や「Facebook」ではなく「Comment」と表示させようとしています。そして「Done」と表示され、「Send」と「Post」と表示されます。これらをどのように/どこで作成/カスタマイズできるかについてのアイデアはありますか?

4

1 に答える 1

4

これらはプライベートビューコントローラです。それらをカスタマイズすることはできません(まあ、そうすべきではありません)。自分で再実装する必要があります。

ただし、privateメソッド-recursiveDescriptionを使用して、ビュー階層がどのように構築されているかを知ることができます。を使用してテキストを共有するシンプルなアプリを作成しますUIActivityViewController。それを提示し、TwitterまたはFacebookを選択してから、デバッガーでアプリを一時停止します。コンソールに入力po [[[UIApplication sharedApplication] keyWindow] recursiveDescription]して、現在のビュー階層を一覧表示します。

編集:わかりました、私は興味がありました…</ p>

   | <UIImageView: 0x75c7830; frame = (0 0; 320 568); opaque = NO; autoresize = W+H; userInteractionEnabled = NO; layer = <CALayer: 0x75c7890>>
   | <UIView: 0x75c7900; frame = (0 20; 320 548); opaque = NO; autoresize = LM+W+RM+H; layer = <CALayer: 0x75c7960>>
   |    | <SLTwitterSheetCardView: 0x75b4950; frame = (-9 25; 337 188); opaque = NO; autoresize = W+H; layer = <CALayer: 0x75b4a40>>
   |    |    | <UIView: 0x75c86b0; frame = (13 0; 311 188); clipsToBounds = YES; autoresize = W+H; layer = <CALayer: 0x75c8710>>
   |    |    |    | <UIImageView: 0x767b680; frame = (0 3; 311 184); clipsToBounds = YES; alpha = 0.75; opaque = NO; autoresize = W+TM+H; userInteractionEnabled = NO; layer = <CALayer: 0x767e4a0>>
   |    |    |    | <UIImageView: 0x7678a50; frame = (0 0; 311 188); opaque = NO; autoresize = W+H+BM; userInteractionEnabled = NO; layer = <CALayer: 0x767b8b0>>
   |    |    |    | <UIView: 0x75c8770; frame = (0 0; 311 188); autoresize = W+H; layer = <CALayer: 0x75c87d0>>
   |    |    |    |    | <SLTwitterExpandedHitTestView: 0x767d950; frame = (6 155; 303 26); opaque = NO; autoresize = RM+TM; layer = <CALayer: 0x767da00>>
   |    |    |    |    |    | <SLTwitterExpandedHitTestImageView: 0x767ea60; baseClass = UIImageView; frame = (30 -6; 272 42); alpha = 0; autoresize = RM+BM; userInteractionEnabled = NO; layer = <CALayer: 0x767eb10>>
   |    |    |    |    |    | <SLTwitterExpandedHitTestButton: 0x767a4e0; baseClass = UIButton; frame = (5 5; 21 21); opaque = NO; autoresize = RM+BM; layer = <CALayer: 0x767a5a0>>
   |    |    |    |    |    |    | <UIImageView: 0x7176770; frame = (0 0; 21 21); clipsToBounds = YES; opaque = NO; userInteractionEnabled = NO; layer = <CALayer: 0x719cb70>>
   |    |    |    |    |    |    | <UIButtonLabel: 0x767c680; frame = (0 0; 0 0); clipsToBounds = YES; hidden = YES; opaque = NO; userInteractionEnabled = NO; layer = <CALayer: 0x767bbe0>>
   |    |    |    |    |    | <SLTwitterExpandedHitTestButton: 0x7193d10; baseClass = UIButton; frame = (120 7; 17 17); alpha = 0; opaque = NO; autoresize = RM+BM; layer = <CALayer: 0x7193660>>
   |    |    |    |    |    |    | <UIImageView: 0x7172000; frame = (0 0; 17 17); clipsToBounds = YES; opaque = NO; userInteractionEnabled = NO; layer = <CALayer: 0x719da50>>
   |    |    |    |    |    |    | <UIButtonLabel: 0x7194900; frame = (0 0; 0 0); clipsToBounds = YES; hidden = YES; opaque = NO; userInteractionEnabled = NO; layer = <CALayer: 0x71949a0>>
   |    |    |    |    |    | <SLTwitterExpandedHitTestButton: 0x767d1a0; baseClass = UIButton; frame = (29 -1; 84 37); alpha = 0.8; opaque = NO; autoresize = RM+BM; layer = <CALayer: 0x767d260>>
   |    |    |    |    |    |    | <UIButtonLabel: 0x767d580; frame = (0 9; 84 16); text = 'Add Location'; clipsToBounds = YES; opaque = NO; userInteractionEnabled = NO; layer = <CALayer: 0x767d620>>
   |    |    |    | <UIView: 0x7678160; frame = (0 0; 311 188); opaque = NO; autoresize = W+H; userInteractionEnabled = NO; layer = <CALayer: 0x76781c0>>
   |    |    | <UIImageView: 0x7680aa0; frame = (0 -34; 337 255); opaque = NO; autoresize = W+H; userInteractionEnabled = NO; layer = <CALayer: 0x7680b00>>
   |    |    | <UILabel: 0x75b4bb0; frame = (282 157; 29 29); text = '132'; clipsToBounds = YES; alpha = 0.7; opaque = NO; autoresize = LM+TM; userInteractionEnabled = NO; layer = <CALayer: 0x75b4c40>>
   |    |    | <UIView: 0x75b5da0; frame = (14 41; 309 3); opaque = NO; autoresize = W+BM; layer = <CALayer: 0x75b5e00>>
   |    |    | <UIButton: 0x75b33e0; frame = (20 7; 64 30); opaque = NO; autoresize = RM+BM; layer = <CALayer: 0x75b34a0>>
   |    |    |    | <UIImageView: 0x719c910; frame = (0 0; 64 30); clipsToBounds = YES; opaque = NO; userInteractionEnabled = NO; layer = <CALayer: 0x716f230>>
   |    |    |    | <UIButtonLabel: 0x75b37d0; frame = (12 7; 40 15); text = 'Cancel'; clipsToBounds = YES; opaque = NO; userInteractionEnabled = NO; layer = <CALayer: 0x75b3870>>
   |    |    | <UIButton: 0x75b3a60; frame = (265 7; 52 30); alpha = 0; opaque = NO; autoresize = RM+BM; layer = <CALayer: 0x75b3b20>>
   |    |    |    | <UIImageView: 0x767dc40; frame = (0 0; 52 30); clipsToBounds = YES; opaque = NO; userInteractionEnabled = NO; layer = <CALayer: 0x76890a0>>
   |    |    |    | <UIButtonLabel: 0x75b3c20; frame = (6 7; 40 15); text = 'Cancel'; clipsToBounds = YES; opaque = NO; userInteractionEnabled = NO; layer = <CALayer: 0x75b3cc0>>
   |    |    | <UIButton: 0x75b3ef0; frame = (263 7; 54 30); opaque = NO; autoresize = LM+BM; layer = <CALayer: 0x75b3fb0>>
   |    |    |    | <UIImageView: 0x768f4f0; frame = (0 0; 54 30); clipsToBounds = YES; opaque = NO; userInteractionEnabled = NO; layer = <CALayer: 0x768eb60>>
   |    |    |    | <UIButtonLabel: 0x75b40e0; frame = (12 7; 30 15); text = 'Send'; clipsToBounds = YES; opaque = NO; userInteractionEnabled = NO; layer = <CALayer: 0x75b4180>>
   |    |    | <UILabel: 0x75c6d40; frame = (139 5; 59 32); text = 'Tweet'; clipsToBounds = YES; opaque = NO; autoresize = W+BM; userInteractionEnabled = NO; layer = <CALayer: 0x75c6a10>>
   |    |    | <UIView: 0x7191800; frame = (14 43; 311 112); clipsToBounds = YES; autoresize = W+H; layer = <CALayer: 0x71952a0>>
   |    |    |    | <UITextView: 0x8227400; frame = (0 0; 311 112); text = 'NSString'; opaque = NO; autoresize = W+H; gestureRecognizers = <NSArray: 0x75b6ff0>; layer = <CALayer: 0x75b6990>; contentOffset: {-0, 10}>
   |    |    |    |    | <UITextSelectionView: 0x75b6bf0; frame = (0 0; 0 0); userInteractionEnabled = NO; layer = <CALayer: 0x75b6ca0>>
   |    |    |    |    | <UIImageView: 0x75b71e0; frame = (0 105; 217 7); alpha = 0; opaque = NO; autoresize = TM; userInteractionEnabled = NO; layer = <CALayer: 0x75b7280>>
   |    |    |    |    | <UIImageView: 0x75b7320; frame = (304 70; 7 37); alpha = 0; opaque = NO; autoresize = LM; userInteractionEnabled = NO; layer = <CALayer: 0x75b73c0>>
   |    |    |    |    | <UIWebDocumentView: 0x8227800; frame = (0 0; 311 45); text = 'NSString'; opaque = NO; userInteractionEnabled = NO; gestureRecognizers = <NSArray: 0x75bc490>; layer = <UIWebLayer: 0x75bb0d0>>
   |    |    |    |    |    | <TileHostLayer: 0x75bb770> (layer)
   |    |    |    |    |    |    | <TileLayer: 0x75c7270> (layer)
   |    |    |    |    | <UITextSelectionView: 0x75c6220; frame = (0 0; 0 0); userInteractionEnabled = NO; layer = <CALayer: 0x75c62a0>>
   |    |    |    |    |    | <UIView: 0x75a09b0; frame = (75 9; 3 24); alpha = 0; userInteractionEnabled = NO; layer = <CALayer: 0x75bde40>>
   |    |    |    |    | <UIView: 0x75b5f10; frame = (-1 41; 311 3); alpha = 0; opaque = NO; autoresize = W+BM; layer = <CALayer: 0x75b5f70>>
   |    |    |    |    | <UIView: 0x8a6ebc0; frame = (0 -216; 313 1); opaque = NO; layer = <CALayer: 0x8a6e750>>
   |    |    |    |    | <UIView: 0x8a6ec50; frame = (0 -188; 313 1); opaque = NO; layer = <CALayer: 0x8a6e600>>
   |    |    |    |    | <UIView: 0x8a6e630; frame = (0 -160; 313 1); opaque = NO; layer = <CALayer: 0x8a6e690>>
   |    |    |    |    | <UIView: 0x8a6e6c0; frame = (0 -132; 313 1); opaque = NO; layer = <CALayer: 0x8a6ecd0>>
   |    |    |    |    | <UIView: 0x8a6ed00; frame = (0 -104; 313 1); opaque = NO; layer = <CALayer: 0x8a6ed60>>
   |    |    |    |    | <UIView: 0x8a6ed90; frame = (0 -76; 313 1); opaque = NO; layer = <CALayer: 0x8a6edf0>>
   |    |    |    |    | <UIView: 0x8a6ee20; frame = (0 -48; 313 1); opaque = NO; layer = <CALayer: 0x8a6ee80>>
   |    |    |    |    | <UIView: 0x8a6ef10; frame = (0 -20; 313 1); opaque = NO; layer = <CALayer: 0x8a6eeb0>>
   |    |    |    |    | <UIView: 0x8a6ef70; frame = (0 8; 313 1); opaque = NO; layer = <CALayer: 0x8a6efd0>>
   |    |    |    |    | <UIView: 0x8a6f000; frame = (0 36; 313 1); opaque = NO; layer = <CALayer: 0x8a6f060>>
   |    |    |    |    | <UIView: 0x8a6f090; frame = (0 64; 313 1); opaque = NO; layer = <CALayer: 0x8a6f0f0>>
   |    |    |    |    | <UIView: 0x8a6f120; frame = (0 92; 313 1); opaque = NO; layer = <CALayer: 0x8a6f180>>
   |    |    |    |    | <UIView: 0x8a6f1b0; frame = (0 120; 313 1); opaque = NO; layer = <CALayer: 0x8a6f210>>
   |    |    |    |    | <UIView: 0x8a6f240; frame = (0 148; 313 1); opaque = NO; layer = <CALayer: 0x8a6f2a0>>
   |    |    | <UIImageView: 0x75b5110; frame = (251 43; 79 34); alpha = 0; autoresize = LM+BM; userInteractionEnabled = NO; layer = <CALayer: 0x75b5170>>

基本的に、それはあなたが期待するものです:たくさんの背景画像、ナビゲーションバースタイルを偽造するためのラベルとボタン、そしてコンテンツの大きなテキストビュー。

于 2012-10-24T13:54:39.460 に答える