我正在開發一個健身應用程序。我的應用程序將有不同的練習,如Push Ups和仰臥起坐。每個練習都需要有一個圖像展示給用戶。 我一直在想什麼是解決這個問題的好方法。但我不認爲我的解決方案是好的。你有沒有使用Android上的圖像來顯示圖像?給我你的解決方案,你是如何做到的。顯示圖像Android
鍛鍊有名字,但也有圖像。目的是顯示圖像和練習名稱的特定練習。
我的運動課程現在看起來像這樣: 我想過要保存圖片的路徑,當我需要顯示圖片時我可以訪問它。我正在上傳資產文件夾中的圖像。
public class Exercise {
private String exerciseName;
private String exerciseSmallImagePath;
private String exerciseLargeImagePath;
public Exercise(String exerciseName, String exerciseSmallImagePath, String exerciseLargeImagePath){
this.exerciseName = exerciseName;
this.exerciseSmallImagePath = exerciseSmallImagePath;
this.exerciseLargeImagePath = exerciseLargeImagePath;
}
}
基於所述excersice的名稱創建一個活動和更改[ImageView的](http://developer.android.com/reference/android/widget/ImageView.html)的形象。 我建議只將圖像添加到資源文件夾,以便您可以按照您的方式訪問它們。 –
那麼你是否面臨目前實施的任何問題? – r4jiv007
'你有沒有在Android上使用圖像來顯示圖像?'這讓我感到很開心:D //你對圖像有什麼問題? – Droidman