嗨我有一個問題,把按鈕放在屏幕的底部我已經把它和在日食中的圖形佈局它看起來完全是我想要它,但是當我運行它在設備上,按鈕都會在相同位置的屏幕底部。所以只有一個按鈕是可見的。有沒有人知道這是爲什麼或者你知道如何將東西放在底部有一些填充?在屏幕底部的Android位置按鈕
繼承人什麼我都試過
<?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:background="@drawable/ic_background_credits"
android:orientation="vertical" >
<Button
android:id="@+id/fm"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="38dp"
android:background="@drawable/fmbtn" />
<Button
android:id="@+id/ph"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/fm"
android:layout_alignLeft="@+id/fm"
android:background="@drawable/visitphbtn" />
</RelativeLayout>
繼承人我的代碼,我誇大這種觀點
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
//Check Preferences which sets UI
setContentView(R.layout.singlenews);
findViewById(R.id.progress).setVisibility(View.GONE);
loadData();
Button backbtn = (Button) findViewById(R.id.backbtn);
//Listening to button event
backbtn.setOnClickListener(new View.OnClickListener() {
public void onClick(View arg0) {
//Starting a new Intent
Intent previousScreen = new Intent(getApplicationContext(), InfoActivity.class);
startActivity(previousScreen);
}
});
}
public void loadData(){
name = getIntent().getStringExtra("name");
Log.v("lc", "infoname=" + name);
if (name.equals(name1")) {
NewsView = LayoutInflater.from(getBaseContext()).inflate(R.layout.infodetail,
null);
TextView headerText = (TextView) findViewById(R.id.header_text);
headerText.setText("About name1");
TextView mainText = (TextView) NewsView.findViewById(R.id.maintext);
mainText.setText("name1");
ImageView NewsImage = (ImageView)NewsView.findViewById(R.id.imageView2);
NewsImage.setImageDrawable(getResources().getDrawable(R.drawable.ic_logo_evostik));
}
if (name.equals("name2")) {
NewsView = LayoutInflater.from(getBaseContext()).inflate(R.layout.infodetail,
null);
TextView headerText = (TextView) findViewById(R.id.header_text);
headerText.setText("About name2");
TextView mainText = (TextView) NewsView.findViewById(R.id.maintext);
mainText.setText("name2");
ImageView NewsImage = (ImageView)NewsView.findViewById(R.id.imageView2);
NewsImage.setImageDrawable(getResources().getDrawable(R.drawable.ic_logo_pitchero));
}
if (name.equals("name3")) {
NewsView = LayoutInflater.from(getBaseContext()).inflate(R.layout.creditsdetail,
null);
TextView headerText = (TextView) findViewById(R.id.header_text);
headerText.setText("name3");
Button phbtn=(Button)NewsView.findViewById(R.id.ph);
phbtn.setOnClickListener(new View.OnClickListener() {
public void onClick(View arg0) {
//Starting a new Intent
Uri uri = Uri.parse("http://www.pitchero.com");
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
}
});
Button fmbtn=(Button)NewsView.findViewById(R.id.fm);
fmbtn.setOnClickListener(new View.OnClickListener() {
public void onClick(View arg0) {
//Starting a new Intent
Uri uri = Uri.parse("http://www.fantasticmedia.co.uk/mobile/");
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
}
});
}
ListView list = getListView();
list.setVerticalFadingEdgeEnabled(false);
Log.v("BGThread", "Filled results");
adapter = new MergeAdapter();
adapter.addView(NewsView);
setListAdapter(adapter);
}
}
沒有看起來不合適的地方...你有沒有嘗試清理你的項目?從Eclipse轉到項目>清潔>選擇你的項目 – Guardanis
我已經嘗試清洗它仍然是同一個問題 –