Android 编辑文本不水平滚动
我已使用以下方法创建了EditText:Android 编辑文本不水平滚动,android,android-edittext,horizontal-scrolling,Android,Android Edittext,Horizontal Scrolling,我已使用以下方法创建了EditText: <style name="foredits"> <item name="android:layout_width">wrap_content</item> <item name="android:layout_height">wrap_content</item> <item name="android:singleLine">true</ite
<style name="foredits">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:singleLine">true</item>
<item name="android:maxLines">1</item>
<item name="android:scrollHorizontally">true</item>
<item name="android:typeface">monospace</item>
<item name="android:imeOptions">actionNext</item>
</style>
这似乎也不起作用。我如何使它起作用?您的代码似乎很好。我为垂直滚动条做了以下操作 xml
您可以在编辑文本中使用以下参数
edittext.setFocusable(false);
edittext.setClickable(false);
edittext.setFocusableInTouchMode(false);
edittext.setEnabled(true);
edittext.setKeyListener(null);
edittext.setHorizontallyScrolling(true);
因此,它将按照所需的行为工作。我可以显示您的xml代码吗?当然,我只需要让它工作。我现在正在寻找水平滚动,但在实现垂直滚动时,我将参考您的答案
edittext.setFocusable(false);
edittext.setClickable(false);
edittext.setFocusableInTouchMode(false);
edittext.setEnabled(true);
edittext.setKeyListener(null);
edittext.setHorizontallyScrolling(true);