public class MessageActivity extends Activity {
private ListView mMessageList;
//Additional properties ...
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.messagepage);
//Bind XML objects
mMessageList = (ListView)findViewById(R.id.MessageList);
//...
//Additional setup and configuation
//...
//MessageList is a dummy content string array
//located in res/values/strings.xml
String[] mMessages =
getResources().getStringArray(R.array.MessageList);
//Simple way for example
mMessageList.setAdapter(new ArrayAdapter(this,
android.R.layout.simple_list_item_1, mMessages));
// mMessageList.setAdapter(
// new EfficientAdapter(this, android.R.layout.simple_list_item_1,
// android.R.id.text1, mMessages));
}
}
At this point I have a ListView defined on a page with other content. The ListView is connected to an ArrayAdapter which supplies it with dummy content through a string array in res/values/strings.xml. Next I wanted to add a border to the ListView to help define its size and make it clear where the edges of the ListView were. I was surprised that it was so difficult to figure out. There is no border property in ListView which was disappointing. I tried various options and found the solution I like the best is putting the ListView in a FrameLayout. I set the Background color of the FrameLayout to the color I want for my border and set the padding to the desired border width. The results look something like this.
This comment has been removed by the author.
ReplyDeleteThis is such a great post, and was thinking much the same myself. Another great update.
ReplyDeleteJava training in Chennai | Java training in USA | Java training in Kalyan nagar
Java training in Indira nagar | Java training in Rajaji nagar
You truly did more than visitors’ expectations. Thank you for rendering these helpful, trusted, edifying and also cool thoughts on the topic to Kate.
ReplyDeleteiosh course in chennai
You blog post is just completely quality and informative. Many new facts and information which I have not heard about before. Keep sharing more blog posts.
ReplyDeletedevops online training
aws online training
data science with python online training
data science online training
rpa online training
I believe there are many more pleasurable opportunities ahead for individuals that looked at your site.
ReplyDeleteData science Course Training in Chennai |Best Data Science Training Institute in Chennai
RPA Course Training in Chennai |Best RPA Training Institute in Chennai
AWS Course Training in Chennai |Best AWS Training Institute in Chennai
Devops Course Training in Chennai |Best Devops Training Institute in Chennai
Selenium Course Training in Chennai |Best Selenium Training Institute in Chennai
Java Course Training in Chennai | Best Java Training Institute in Chennai
Thank you for sharing such great information with us. I really appreciate everything that you’ve done here and am glad to know that you really care about the world that we live in...
ReplyDeleteMySQL Online Training | MySQL Training Course
This comment has been removed by the author.
ReplyDeletenice post......!
ReplyDeleteinplant training in chennai
inplant training in chennai
inplant training in chennai for it
italy web hosting
afghanistan hosting
angola hosting
afghanistan web hosting
bahrain web hosting
belize web hosting
india shared web hosting
2019 neural networks projects chennai, neural networks projects chennaiWe have real timing Cost, ENDDAD, MOV, VLSI, C), C++, NS2, Linux, dotnet, linux, mysql, web technologies, biomedical, strong, SSL, Wireless communicationPh. D / M.Phill / M.E / M.Tech /M.Sc (CSE)/MCA / MBA / B.Tech(CSE)/B.Sc./B.Sc./B.CA /research project centers in chennai
ReplyDeleteBest AWS Training provided by Vepsun in Bangalore for the last 12 years. Our Trainer has more than 20+ Years
ReplyDeleteof IT Experience in teaching Virtualization and Cloud topics.. we are very delighted to say that Vepsun is
the Top AWS cloud training Provider in Bangalore. We provide the best atmosphere for our students to learn.
Our Trainers have great experience and are highly skilled in IT Professionals. AWS is an evolving cloud
computing platform provided by Amazon with a combination of IT services. It includes a mixture of
infrastructure as service and packaged software as service offerings and also automation. We have trained
more than 10000 students in AWS cloud and our trainer Sameer has been awarded as the best Citrix and Cloud
trainer in india.