Monday, April 14, 2014

Inheritance Toast, using a custom layout, how to get on the Samsung 9250 is not full, seek expert advice


Layout file:

android: layout_height = "match_parent"
android: layout_width = "fill_parent"
>
android: layout_height = "wrap_content"
android: layout_width = "fill_parent"
android: id = "@ + id / mbContainer"
android: layout_alignParentBottom = "true"
>

android: layout_width = "fill_parent"
android: layout_height = "36.6dp"
android: textColor = "@ color / account_text_white"
android: textSize = "13.3dp"
android: background = "@ color / account_btn_black"
android: alpha = "0.7"
android: gravity = "center"
/>



Code:
public static MessageBar initView (Context context, CharSequence text,
int duration)
{
MessageBar result = new MessageBar (context);
result.setMargin (0, 0);
LayoutInflater inflate = (LayoutInflater) context.getSystemService (Context.LAYOUT_INFLATER_SERVICE);
v = inflate.inflate (R.layout.mb_messagebar, null);
TextView tv = (TextView) v.findViewById (R.id.mbMessage);
tv.setText (text);
result.setView (v);
result.setDuration (duration);
return result;
}
<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
The problem has been resolved, offer links http://blog.csdn.net/liangjixunx/article/details/11803843

No comments:

Post a Comment