Do you know how to draw line on the LinearLayout? To create a LinearLayout, I am using a xml resource:
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main_layout);
LinearLayout linear = (LinearLayout)findViewById(R.id.linearlayout);
//I wanna draw line on "linear"
}
Is it possible ?
There are many ways; one way is to define a
ShapeDrawablerepresenting the line in XML (in yourresfolder) and set that as the background resource of say, anImageViewinside theLinearLayout.You can read more about drawables and 2D graphics in general in the docs.
Feel free to provide some more context (specific use case) so I could elaborate on this answer or others could answer.