English 中文(简体)
将文本查看添加到滚动中布局View
原标题:Add TextView to layout inside scrollView

I have a LinearLayout within a ScrollView in the xml file. I need to paint and write within the ScrollView so I ve created a view in the layout and have been able to paint and write inside using: canvas.draw() and canvas.drawText(), my problem comes when writing text with canvas are not clearly the letters, so I need to add a TextView to the layout of the ScrollView from the class, without knowing very well how to do it. Paste the code:

public class Calendario extends Activity{
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.calendar);        
        LinearLayout layout = (LinearLayout) findViewById(R.id.layout);
        MyView v = new MyView(this);
        layout.addView(v,250,2000);
     }

    private class MyView extends View{
        public MyView(Context context) {
            super(context);
        }
        protected void onDraw(Canvas canvas) {
            onDrawMethod();
            //Here draw and write text//
        }
     }
}

I need only add textviews inside A picture of what I need: I need only add textviews inside Thankss

最佳回答

据我理解,你想要在方案上增加这些案文,办法是说:

所以我需要从班上添加一个文本视图到滚动视图的布局

如果是这样的话,也许

问题回答

暂无回答




相关问题
Very basic WPF layout question

How do I get this listbox to be maxiumum size, i.e. fill the group box its in. I ve tried width="auto" Height="auto", width="stretch" Height="stretch" annoyingly at the moment, it dynamicly sizes to ...

How to align the text to top of TextView?

How to align the text to top of a TextView? Equivalent Android API for Swings setInsets()? that is top of text should start be in (0,0) of TextView <?xml version="1.0" encoding="utf-8"?> <...

Centring a flow in Shoes

Can I center the contents of a flow in Shoes? I know that a paragraph can be centred like: para Centred paragrpah , :align=> center However, this does not work with flows: flow(:align=> ...

Overlaying with CSS

I want to load a website in an iframe, and overlay the website with some hints about the website that is shown. However, i got stuck at the point that the website has a variable passive white space at ...

How do you normally make a program look beautiful? [closed]

How can I make an Application look nice and not like an amateur pulled it together? I mean graphic-wise. Is there some sort of book you can read regarding beautiful program layouts, etc? I put this ...