2016-08-02 22 views
0

私はストーリーボードのビューコントローラにテーブルビューを埋め込んでいます。テーブルビューには3つのテーブルビューセルがあります。各セルには、「A」、「B」、「C」という1文字のテキストがあります。文字は、Visual Studioで私の画面上に表示されますが、私はシミュレータでアプリケーションを実行すると、私は何も見えません。テーブル/セルが有効になっていることを二重チェックしました。以下のStoreboard XML。Xamarin for VSテーブルビューのセルにラベルテキストが表示されない

<?xml version="1.0" encoding="UTF-8" standalone="no"?> 
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6211" systemVersion="14A298i" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r"> 
    <dependencies> 
     <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6204"/> 
    </dependencies> 
    <scenes> 
     <!--View Controller--> 
     <scene sceneID="tne-QT-ifu"> 
      <objects> 
       <viewController id="BYZ-38-t0r" customClass="ViewController" customModuleProvider="" sceneMemberID="viewController"> 
        <layoutGuides> 
         <viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/> 
         <viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/> 
        </layoutGuides> 
        <view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC"> 
         <rect key="frame" x="0.0" y="0.0" width="600" height="600"/> 
         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> 
         <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/> 
         <subviews> 
          <containerView contentMode="scaleToFill" id="5" translatesAutoresizingMaskIntoConstraints="NO" fixedFrame="YES"> 
           <rect key="frame" x="116" y="126" width="320" height="300"/> 
           <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/> 
           <connections> 
            <segue id="66" destination="13" kind="embed"/> 
           </connections> 
          </containerView> 
         </subviews> 
        </view> 
       </viewController> 
       <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/> 
      </objects> 
      <point key="canvasLocation" x="0.0" y="0.0"/> 
     </scene> 
     <scene sceneID="12"> 
      <objects> 
       <tableViewController id="13" sceneMemberID="viewController"> 
        <tableView key="view" opaque="NO" clipsSubviews="YES" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" id="14"> 
         <rect key="frame" x="0.0" y="0.0" width="320" height="300"/> 
         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> 
         <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> 
         <prototypes> 
          <tableViewCell contentMode="scaleToFill" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" id="17" rowHeight="44"> 
           <rect key="frame" x="0.0" y="22" width="320" height="44"/> 
           <autoresizingMask key="autoresizingMask"/> 
           <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="17" id="18"> 
            <rect key="frame" x="0.0" y="0.0" width="320" height="43.5"/> 
            <autoresizingMask key="autoresizingMask"/> 
           </tableViewCellContentView> 
          </tableViewCell> 
          <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="72" rowHeight="44" indentationLevel="0" style="IBUITableViewCellStyleDefault" textLabel="76"> 
           <rect key="frame" x="0.0" y="66" width="320" height="44"/> 
           <autoresizingMask key="autoresizingMask"/> 
           <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="72" id="73"> 
            <rect key="frame" x="0.0" y="0.0" width="320" height="43.5"/> 
            <autoresizingMask key="autoresizingMask"/> 
            <subviews> 
             <label opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="left" text="A" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="76"> 
              <rect key="frame" x="16" y="0.0" width="288" height="43.5"/> 
              <autoresizingMask key="autoresizingMask"/> 
              <fontDescription key="fontDescription" type="system" pointSize="18"/> 
              <color key="textColor" cocoaTouchSystemColor="darkTextColor"/> 
              <nil key="highlightedColor"/> 
             </label> 
            </subviews> 
           </tableViewCellContentView> 
          </tableViewCell> 
          <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="77" rowHeight="44" style="IBUITableViewCellStyleDefault" textLabel="81"> 
           <rect key="frame" x="0.0" y="110" width="320" height="44"/> 
           <autoresizingMask key="autoresizingMask"/> 
           <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="77" id="78"> 
            <rect key="frame" x="0.0" y="0.0" width="320" height="43.5"/> 
            <autoresizingMask key="autoresizingMask"/> 
            <subviews> 
             <label opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="left" text="B" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="81"> 
              <rect key="frame" x="16" y="0.0" width="288" height="43.5"/> 
              <autoresizingMask key="autoresizingMask"/> 
              <fontDescription key="fontDescription" type="system" pointSize="18"/> 
              <color key="textColor" cocoaTouchSystemColor="darkTextColor"/> 
              <nil key="highlightedColor"/> 
             </label> 
            </subviews> 
           </tableViewCellContentView> 
          </tableViewCell> 
          <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="79" rowHeight="44" style="IBUITableViewCellStyleDefault" textLabel="82"> 
           <rect key="frame" x="0.0" y="154" width="320" height="44"/> 
           <autoresizingMask key="autoresizingMask"/> 
           <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="79" id="80"> 
            <rect key="frame" x="0.0" y="0.0" width="320" height="43.5"/> 
            <autoresizingMask key="autoresizingMask"/> 
            <subviews> 
             <label opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="left" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="82" text="C"> 
              <rect key="frame" x="16" y="0.0" width="288" height="43.5"/> 
              <autoresizingMask key="autoresizingMask"/> 
              <fontDescription key="fontDescription" type="system" pointSize="18"/> 
              <color key="textColor" cocoaTouchSystemColor="darkTextColor"/> 
              <nil key="highlightedColor"/> 
             </label> 
            </subviews> 
           </tableViewCellContentView> 
          </tableViewCell> 
         </prototypes> 
         <connections> 
          <outlet property="dataSource" destination="13" id="15"/> 
          <outlet property="delegate" destination="13" id="16"/> 
         </connections> 
        </tableView> 
       </tableViewController> 
       <placeholder placeholderIdentifier="IBFirstResponder" id="19" userLabel="First Responder" sceneMemberID="firstResponder"/> 
      </objects> 
      <point key="canvasLocation" x="646" y="-5"/> 
     </scene> 
    </scenes> 
</document> 
+0

【のUITableViewController外部スタティックテーブルビュー(http://stackoverflow.com/questions/22364230/static-table-view-outside-uitableviewcontroller)の可能性の重複 –

答えて

0

答えは下のリンクで見つけることができます。そのリンクの議論はXcodeのためのものですが、解決策は同じです。テーブルビューコントローラを作成します。 View Controllerにコンテナビューを追加し、その中にTable View Controllerを埋め込みます。テーブルビューの内容を「静的セル」に変更し、セクションを追加します。そこから一歩進んだはずの簡単なテーブルを編集できますが、どうにかして5になりました!

Xamarinは、静的でないセル内容表に属するセルにテキストすぎるラベルを追加する機能を削除する必要があります。それはちょうど混乱している。

Static table view outside UITableViewController

関連する問題