1

一旦测试字符串超过了 textarea 的宽度,我希望 textarea 水平滚动。我尝试了下面的代码,但是由于某种原因它不起作用。

我还尝试将包装视图添加到滚动视图并将文本区域添加到包装视图;但这也不起作用。

我怎样才能解决这个问题 ?

 var scroll = Ti.UI.createScrollView({
     top:40,
     left:230,
     width:290,
     height:50
});
win.add(scroll);

var textType = Ti.UI.createTextArea({
   backgroundColor:'#E6E6E6',
   borderColor:'blue',
   borderRadius:10,
   top:0,
   left:0,
   width:290,
   height:50,
   font:{fontSize:26, fontFamily:customFont},
   editable:false,
   enabled:false,
   textAlign:'right',
   scrollable:true
  });
 scroll.add(textType);
4

1 回答 1

0

我知道这听起来很简单,但是默认情况下,文本区域是垂直可滚动的。这是我所知道的唯一行为。我尝试了不同的属性,例如:

    layout:"horizontal",
    horizontalWrap:true,
    scrollable:true, 

但这并没有解决问题。

于 2013-07-31T17:20:24.013 回答