我已经创建了抽屉布局示例应用程序,它工作正常,我的问题是抽屉布局从右到左完美地工作但我试图将图标左侧移动到右侧但它不起作用给我你的建议.. !!! 这有可能吗?

<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="right" >
<!-- The main content view -->
<FrameLayout
android:id="@+id/content_frame"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
<!-- The navigation drawer -->
<ListView
android:id="@+id/drawer_list"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="right"
android:background="#111"
android:choiceMode="singleChoice"
android:divider="@android:color/transparent"
android:dividerHeight="0dp" />
</android.support.v4.widget.DrawerLayout>
Run Code Online (Sandbox Code Playgroud) 嗨,我正在尝试为我的相对布局设置alpha值但是,我得到错误如何解决这个帮助我.....
我在我的xml布局中有三个布局第一个布局用于背景第二个布局用于标题第三个布局用于页脚.我希望设置alpha值2和第3布局,所以我尝试了很多方法仍然我不知道请告诉如何设置alpha值
xml代码:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_alignParentLeft="true"
android:orientation="vertical"
android:background="@drawable/blue">
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="60px"
android:orientation="horizontal"
android:layout_alignParentTop="true"
android:background="@drawable/gradient_black"
android:id="@+id/ttest">
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<TextView
android:id="@+id/header_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="6dp"
android:layout_toRightOf="@+id/imageView1"
android:text="settings"
android:textColor="@color/white"
android:textSize="20sp" />
</RelativeLayout>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="55px"
android:background="@drawable/gradient_black"
android:gravity="bottom"
android:orientation="horizontal"
android:layout_alignParentBottom="true" >
<ImageView
android:id="@+id/imageView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="ssss"
/>
</RelativeLayout>
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
码:
public class DesignActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
int …Run Code Online (Sandbox Code Playgroud) 我的办公系统已经在Eclipse中安装了一些Android SDK版本1.5,1.6,2.1,2.2,2.3,3.1,3.2.这些版本工作正常.现在我想安装4.0版,但我不知道?如何在我的Eclipse中安装Android 4.0 Ice Cream Sandwich?我正在使用Ubuntu 10.04.
另外如果您知道如何在Windows下安装Android 4.0,请告诉我.
eclipse installation ubuntu sdk android-4.0-ice-cream-sandwich
我创建了旋转木马设计应用程序,它工作正常.我希望在屏幕中央显示一个默认徽标.所以我尝试了很多方法,请帮助我.
这是我的屏幕截图:

我希望在旋转木马设计的中心显示一个标志.
这是我的xml源代码:
>
<LinearLayout
android:layout_weight="0.5"
android:padding="5dip"
android:gravity="top"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<com.globems.controls.Carousel
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/carousel"
pj:UseReflection="true"
pj:Items="@array/entries"
pj:Names="@array/names"
pj:SelectedItem="0"
android:animationDuration="200"
/>
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_launcher" />
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
在这段代码中我使用imageview来显示徽标,但它不起作用.
更新了xml:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:pj="http://schemas.android.com/apk/res/com.globems.main"
xmlns:bm="com.carousel.main"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background ="@drawable/blue3"
>
<RelativeLayout
android:layout_weight="0.5"
android:padding="5dip"
android:gravity="top"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<com.globems.controls.Carousel
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/carousel"
pj:UseReflection="true"
pj:Items="@array/entries"
pj:Names="@array/names"
pj:SelectedItem="0"
android:animationDuration="200"
/>
<ImageView
android:id="@+id/imageView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_launcher"
android:centerinHorizontal="true"
/>
</RelativeLayout>
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud) 我创建了简单的视频视图应用程序,它工作正常.我已将layoutparams添加到视频视图中,并将videoview添加到一个布局位置,那时我的媒体控制器显示在该区域之外,但我希望在视频上显示媒体控制器.请给我你有用的建议.
屏幕截图:
码:
public class MainActivity extends Activity {
private VideoView view;
RelativeLayout layoutmain, layout;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
layoutmain = (RelativeLayout) findViewById(R.id.id1);
MediaController controller = new MediaController(this);
view = new VideoView(this);
view.setVideoPath("/mnt/sdcard/jj.avi");
RelativeLayout.LayoutParams viewparam = new RelativeLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT);
viewparam.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
viewparam.addRule(RelativeLayout.ALIGN_PARENT_TOP);
viewparam.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
viewparam.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
view.setLayoutParams(viewparam);
FrameLayout.LayoutParams viewparam1 = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.WRAP_CONTENT, FrameLayout.LayoutParams.WRAP_CONTENT);
controller.setLayoutParams(viewparam1);
view.setMediaController(controller);
controller.setAnchorView(controller);
view.requestFocus();
view.start();
try {
layout = new RelativeLayout(this);
RelativeLayout.LayoutParams viewparam2 = new RelativeLayout.LayoutParams(500, 500);
viewparam2.setMargins(20, 20, 0, 0);
layout.setLayoutParams(viewparam2);
layout.setBackgroundColor(Color.BLACK);
layout.addView(view);
layout.addView(controller);
} …Run Code Online (Sandbox Code Playgroud) 我创建了简单的gridview应用程序.现在我希望为我的图像创建发光效果,请帮我如何为我的网格视图图像创建发光效果?如果有人知道请给我一些想法和示例代码....
这是我目前的截图:

这是我预期的发光效果截图:

源代码:
main.xml中:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello" />
<GridView
android:id="@+id/gridview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:numColumns="auto_fit"
android:verticalSpacing="10dp"
android:horizontalSpacing="10dp"
android:columnWidth="90dp"
android:stretchMode="columnWidth"
android:gravity="center" />
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
GridviewExampleActivity.java
public class GridviewExampleActivity extends Activity
{
public void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
GridView gridview = (GridView) findViewById(R.id.gridview);
gridview.setAdapter(new ImageAdapter(this));
}
public class ImageAdapter extends BaseAdapter{
private Context mContext;
public ImageAdapter(Context c){
mContext = c;
}
public int getCount()
{
return mThumbIds.length;
}
public Object getItem(int position)
{
return null; …Run Code Online (Sandbox Code Playgroud) 我已下载示例tablelayout源代码,它工作正常.我试图在表格布局的底部显示四个图像按钮但仍然没有工作.
当前图片:

我试图在表格布局的底部显示这4个按钮:

这是我的代码:我希望在我的表格布局底部合并我的源代码请帮助我.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal" >
<Button
android:id="@+id/ttt3"
android:layout_width="150dip"
android:layout_height="40dip"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:background="@drawable/bt_blue" />
<Button
android:id="@+id/ttt2"
android:layout_width="150dip"
android:background="@drawable/bt_yellow"
android:layout_height="40dip"
android:layout_alignParentBottom="true"
android:layout_marginRight="20dp"
android:layout_toLeftOf="@+id/ttt3"
/>
<Button
android:id="@+id/ttt1"
android:layout_width="150dip"
android:background="@drawable/bt_green"
android:layout_height="40dip"
android:layout_alignParentBottom="true"
android:layout_marginRight="20dp"
android:layout_toLeftOf="@+id/ttt2"
/>
<Button
android:id="@+id/ttt0"
android:layout_width="150dip"
android:layout_height="40dip"
android:background="@drawable/bt_red"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:gravity="bottom"
/>
</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)
表格代码:
<?xml version="1.0" encoding="utf-8"?>
<TableLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/tableLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:shrinkColumns="*"
android:stretchColumns="*">
<TableRow
android:id="@+id/tableRow4"
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:gravity="center_horizontal">
<TextView
android:id="@+id/textView9"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textStyle="bold"
android:typeface="serif"
android:textSize="18dp"
android:text="Weather Table"
android:gravity="center"
android:layout_span="6"></TextView>
</TableRow>
<TableRow
android:id="@+id/tableRow1"
android:layout_height="wrap_content" …Run Code Online (Sandbox Code Playgroud) android ×6
alpha ×1
android-4.0-ice-cream-sandwich ×1
center ×1
drawerlayout ×1
eclipse ×1
glow ×1
gridview ×1
image ×1
imageview ×1
installation ×1
layout ×1
sdk ×1
tablelayout ×1
ubuntu ×1
ui-design ×1
view ×1