मैं एंड्रॉयड एसडीके में नोटपैड नमूना पर एक नज़र ले रहा था यहाँ देखें: http://developer.android.com/resources/samples/NotePad/src/com/example/android/notepad/NoteEditor.htmledittext में एकाधिक रेखाएं खींचना उदा। नोटपैड
बात है यह केवल वर्तमान पंक्ति कर्सर जैसे http://cdn2.staztic.com/screenshots/simple-notepad-app-al-1.jpg
पर है खींचता है लेकिन मैं लाइनों प्रदर्शित करना चाहते हैं जो स्क्रीन को भरें उदाहरण के लिए http://www.itismyworld.info/wp-content/uploads/2010/03/AK-notebook.png
कोई भी सुझाव बहुत अच्छा होगा। कोड का रिलीज बिट यहां प्रतीत होता है:
protected void onDraw(Canvas canvas) {
// Gets the number of lines of text in the View.
int count = getLineCount();
// Gets the global Rect and Paint objects
Rect r = mRect;
Paint paint = mPaint;
/*
* Draws one line in the rectangle for every line of text in the EditText
*/
for (int i = 0; i < count; i++) {
// Gets the baseline coordinates for the current line of text
int baseline = getLineBounds(i, r);
/*
* Draws a line in the background from the left of the rectangle to the right,
* at a vertical position one dip below the baseline, using the "paint" object
* for details.
*/
canvas.drawLine(r.left, baseline + 1, r.right, baseline + 1, paint);
}
// Finishes up by calling the parent method
super.onDraw(canvas);
}
+1 अच्छा स्पष्टीकरण .... –