06-02-2010 10:41 PM
Hello,
I am making a list of friends in my app. but when i scroll that list its giving some UI issues like not showing all the images.
Have a look on below images.
THIS IS THE SCREEN
WHEN I SCROLL IT DOWN THEN
06-02-2010 11:22 PM
Could you please make images publicly available somewhere? I can see nothing...
06-03-2010 02:09 AM
i think you are not setting the rowheight of the list properly. use
_list1.setrowheight(40); //like this
also the bitmap you are trying to use, see whether you are giving the proper image size while drawing.
if poss can you provide the snippet in which you are trying to draw the list. since i am not able to change the color of the list.(means by default it is coming blue).
06-03-2010 02:54 AM - edited 06-03-2010 02:56 AM
thanks swapnil,
actually i m using horizontalfiledmanager here and adding components into that like images, labels, but as i have seen on the blog that we cant change the background color of managers. thats why here i m using the arrow image.
the image is proper and i m not resizing it. but i dont know why this blurring is cmng.
Code :
public class CustomVertical extends VerticalFieldManager{
public CustomVertical() {
super(VerticalFieldManager.USE_ALL_WIDTH | VerticalFieldManager.USE_ALL_HEIGHT | Field.FIELD_HCENTER | VerticalFieldManager.FOCUSABLE);
}
protected void sublayout(int maxWidth, int maxHeight){
Field field;
//get total number of fields within this manager
int numberOfFields = getFieldCount();
int x = 60;
int y = 2;
for (int i = 0;i < numberOfFields;i++) {
field = getField(i); //get the field
setPositionChild(field,x,y); //set the position for the field
layoutChild(field, maxWidth, maxHeight); //lay out the field
y += 30;
}
maxWidth = Graphics.getScreenWidth();
maxHeight = 50;
setExtent(maxWidth, maxHeight);
}
protected void paintBackground(Graphics graphics)
{
// Sets the BackgroundColor
graphics.setBackgroundColor(Color.LIGHTGREY);
// Clears the entire graphic area to the current background
graphics.clear();
}
public void paint(Graphics graphics) {
graphics.setBackgroundColor(Color.RED);
super.paint(graphics);
graphics.drawBitmap(5, 5, 100, 100, Bitmap.getBitmapResource("girl.jpeg"), 0, 0);
// Clears the entire graphic area to the current background
// graphics.clear();
}
public VerticalFieldManager getFriendsList(String friendName, String status) {
Bitmap arrow = Bitmap.getBitmapResource("chevron_right_black_15x2
CustomVertical customVerticalList = new CustomVertical();
FontFamily fontfam[] = FontFamily.getFontFamilies();
Font fon[] = new Font[2];
fon[0] = fontfam[0].getFont(FontFamily.SCALABLE_FONT, 18);
fon[1] = fontfam[0].getFont(FontFamily.SCALABLE_FONT, 13);
LabelField User = new LabelField(friendName);
LabelField Status = new LabelField(status);
User.setFont(fon[0]);
Status.setFont(fon[1]);
// CustomVertical2 c2 = new CustomVertical2();
customVerticalList.add(User);
customVerticalList.add(Status);
BitmapField add = new BitmapField(arrow, BitmapField.FOCUSABLE){
protected boolean navigationClick(int status, int time) {
// This is method will invoke when you click on your bitmapfield and you can write your piece of code here
UiApplication.getUiApplication().pushScreen(new FriendProfileScreen());
return true;
}
};
DualFieldManager dualFieldmanager = new DualFieldManager(customVerticalList, add);
return dualFieldmanager;
}
Using like
// Dummy Data
add(getFriendsList("Kristen", "On Call"));
add(new SeparatorField());
add(getFriendsList("Priya", "Available"));
add(new SeparatorField());
add(getFriendsList("Ayesha", "Available"));
add(new SeparatorField());
add(getFriendsList("Somya", "Available"));
add(new SeparatorField());
add(getFriendsList("Mapet", "On Call"));
add(new SeparatorField());
add(getFriendsList("Vonz", "Available"));
add(new SeparatorField());
06-03-2010 04:38 AM
why don't you use a listfield? it would be the exact usecase of it imo.
06-11-2010 12:46 AM
plz find attachment than you will clear my problem.
Thanks
Zahid