菜鸟教程小白 发表于 2022-12-13 09:29:32

c# - MonoTouch Dialog 自定义字体


                                            <p><p>我对 MonoTouch 比较陌生,注意到 MonoTouch Dialog api 非常有用。我想要实现的是这样的:</p>

<p> <img src="/image/v6dqT.png" alt="enter image description here"/>
<a href="http://img641.imageshack.us/img641/8514/consumentstartscherm.png" rel="noreferrer noopener nofollow">http://img641.imageshack.us/img641/8514/consumentstartscherm.png</a> </p>

<p>所以我想要表格 View 单元格中的常规文本.. 但我怎样才能做到这一点?目前我将我的文本放在标题部分,但那是粗体。</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>这样的事情会让你接近:</p>

<pre><code>      var label = new UILabel ();
      var frame = label.Frame;
      frame.Inflate (0, 32);
      label.Frame = frame;
      label.Font = UIFont.BoldSystemFontOfSize (32);
      label.Text = &#34;Ad4You&#34;;
      label.TextAlignment = UITextAlignment.Center;
      label.BackgroundColor = UIColor.FromWhiteAlpha (0f, 0f);

      Section s = new Section (&#34;Ad4You&#34;);
      s.HeaderView = label;

      s.Add (new StyledMultilineElement (String.Empty,
            &#34;Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.&#34;,
            UITableViewCellStyle.Subtitle));

      var root = new RootElement (&#34;Home&#34;);
      root.Add (s);

      var dv = new DialogViewController (root, true) { Autorotate = true };
      NavigationController.PushViewController (dv, true);            
</code></pre>

<p>享受 MonoTouch 和 MonoTouch.Dialog 的乐趣 :-)</p></p>
                                   
                                                <p style="font-size: 20px;">关于c# - MonoTouch Dialog 自定义字体,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/7850480/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/7850480/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: c# - MonoTouch Dialog 自定义字体