开发者

dynamic margin inside edittext

开发者 https://www.devze.com 2023-03-03 10:34 出处:网络
First, let me say, new to java, new to android. I\'m attacking this head- with an ambitious first real project, a special kind of text editor.

First, let me say, new to java, new to android. I'm attacking this head- with an ambitious first real project, a special kind of text editor. I have figured out styling usin开发者_StackOverflowg spannables, but thats not particularly important. I need a dynamic margin inside edittext. when I click the button, I want it to indent all of the text after that, on both left and right, until there is a carriage return, then it should drop back to no indent on a new line.

Think dialog in a play for an example of the output.

Thanks in advance for any information you might lend.


The answer in this post (look at the OLD ANSWER part) should help you solve the margin problem, but you can't have two different margins in one edit text. Consider creating a new edit text when a user presses carriage return or something of the sort.

Hope it helps.

0

精彩评论

暂无评论...
验证码 换一张
取 消