title: Android :: TextView :: Programitic Creation with setSingleLine(false) - Not wrapping
body: <p>I'm setting a textview as a child to a TableRow view programmatically and I cannot seem to get the text to wrap inside of the parent.</p>
  
  <p>Here is the code which should be wrapping the text inside of the TableRow. Notice the setSingleLine is being set to false.</p>
  
  <pre><code>            TextView value = new TextView(this);
      ![alt text][1]value.setLayoutParams(new TableRow.LayoutParams(
              LayoutParams.FILL_PARENT,
              LayoutParams.WRAP_CONTENT));
  
      value.setSingleLine(false);
      value.setEllipsize(TruncateAt.END);
      value.setHorizontallyScrolling(false);
  
      value.setText(txt);
      value.setTextColor(Color.BLACK);
      value.setTextSize(12);
      value.setTypeface(generalFont);
  </code></pre>
  
  <p>The documentation doesn't say by setting it to false will make it multiline, it says it will restore it to the defaults.</p>
  
  <blockquote>
    <p>setSingleLine(boolean singleLine)
    If true, sets the properties of this field (lines, horizontally scrolling, transformation method) to be for a single-line input; if false, restores these to the default conditions.</p>
  </blockquote>
  
  <p>Does anybody have a code snippet or URL which points to a multiline TextView being created programmatically?</p>
  
  <p>TEXT IN TEXT VIEW</p>
  
  <blockquote>
    <p>Lorem ipsum dolor sit amet,
    consectetur adipiscing elit. Phasellus
    tempus porttitor diam, sit amet rutrum
    nunc laoreet at. Mauris sit amet
    tristique e</p>
  </blockquote>
  
  <p>IMAGE SHOWING THE ISSUE</p>
  
  <p><img src="https://i.stack.imgur.com/jl8Hs.png" alt="TextView not wrapping"></p>