2011-07-10 45 views

回答

0

我最近不得不为一个项目做到这一点,并能够通过手动设置宽度和高度请求来完成。将TextView放入HBox(或类似的)也适用。

Toolbar _toolBar = new Toolbar(); 

    TextView t = new TextView(); 
    t.WidthRequest = 200; 
    t.HeightRequest = 20; 
    _toolBar.Add(t); 

    t.Buffer.Text = "Hello World!"; 
    t.Visible = true; 
+0

谢谢。事实证明,添加一个Entry比TextView更容易,但知道我可以做到这一点很好。 – MI3Guy